score:0

Accepted answer

with the help of other users of the play! framework google group, here is how to access the request inside a custom parthandler.

//create a body parser
val mybodyparser = bodyparser { request => 
    parse.multipartformdata(myparthandler(request)).apply(request)
}

 def uploadfile() = action(mybodyparser) 
      {request =>ok("done")}

 def myparthandler(request: requestheader) : bodyparsers.parse.multipart.parthandler[multipartformdata.filepart[result]] = {
    parse.multipart.handlefilepart {
      case parse.multipart.fileinfo(partname, filename, contenttype) =>         
        println(request.session.get("myvaluekey"));

Related Query

More Query from same tag