score:0

Accepted answer

I don't understand why it is happening.

You could add an ugly if statement to prevent the error :

request.body.file("resourceFile").map { k =>
         if (!k.filename.isEmpty) {
             val t = new java.io.File(s"./public/upload/${k.filename}")
             k.ref.moveTo(t, true)
             println("Ok File Upload" + k.filename)
         }

Related Query

More Query from same tag