there is really not much to it, take the example from Play Scala tutorial
def upload = Action(parse.multipartFormData) { request =>
request.body.file("picture").map { picture =>
import java.io.File
val filename = picture.filename
val contentType = picture.contentType
picture.ref.moveTo(new File("/tmp/picture"))
Ok("File uploaded")
}.getOrElse {
Redirect(routes.Application.index).flashing(
"error" -> "Missing file"
)
}
}
I need to set a max limit of the uploaded multipart. This or set some low level netty limit. Either way I'd need to be able to handle the error somehow, or at least have 413 returned by Play.
cheers