playframework / play-ws

Standalone Play WS, an async HTTP client with fluent API
https://www.playframework.com/documentation/latest/JavaWS
Apache License 2.0
223 stars 87 forks source link

there is no doc for file upload #122

Open TopSpoofer opened 7 years ago

TopSpoofer commented 7 years ago

the file upload at play's doc was don't working!

wsargent commented 7 years ago

@TopSpoofer Can you describe how it "doesn't work?"

https://www.playframework.com/documentation/2.5.x/ScalaWS#Submitting-multipart/form-data

djx314 commented 7 years ago

@wsargent it's said that there no doc for the file name's charset. I send a file part with a chinese file name and get a file name with messy code in an ohter play server.

djx314 commented 7 years ago

Just like httpclient's code

MultipartEntityBuilder.create.setMode(HttpMultipartMode.BROWSER_COMPATIBLE)

to avoid the utf-8 file name to post with messy code. But in play-ws I can just write

FilePart("video_0", videoPath.getFileName.toString, Option("text/plain;charset=utf-8"), FileIO.fromPath(videoPath))

And the file name is wrong with messy code.