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

已查看 21 次
跳至第一个未读帖子

sowmya

未读,
2016年6月24日 01:46:432016/6/24
收件人 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)
       }
        
   }

回复全部
回复作者
转发
0 个新帖子