Playframework 2.5.0 : Fileupload - TimeoutException: Request timeout .....to after 120000ms]

21 views
Skip to first unread message

sowmya

unread,
Jun 24, 2016, 1:46:43 AM6/24/16
to play-framework
Please help to resolve. Thanks.


def upload = Action.async(BodyParsers.parse.multipartFormData) { implicit request =>
        
        val tmpFile = new File("/tmp/picture/tmpformuploaded")
        writeFile(tmpFile, "world")


        val url = "http://<HOST>:9000"
        
        val futureResponse: Future[WSResponse] = ws.url(url).post(Source(FilePart("hello", "hello.txt", Option("text/plain"), FileIO.fromFile(tmpFile)) :: DataPart("key", "value") :: List()))

        futureResponse.map { response =>
        
        Ok(response.body)
       }
        
   }

Reply all
Reply to author
Forward
0 new messages