Hi,
I have filenames with non-ascii characters and this is the code that enables me
to encode it in my multipart request:
MultipartEntityBuilder.create().setCharset(StandardCharsets.UTF_8).setLaxMode();
While this generates the content disposition (for filename Mädchen) correctly
as:
Content-Disposition: form-data; name="M[0xc3][0xa4]dchen.pdf";
filename="M[0xc3][0xa4]dchen.pdf"
It also generates content type with a charset parameter like so:
Content-Type: multipart/form-data;
boundary=eUBOAfgS-JvSxb2ok4HhwTdwyKWzloz27CnQ0; charset=UTF-8
This request fails with IIS as noted by many others (61384 – Adding charset to
multipart/form-data content type irritates IIS
(apache.org)<https://bz.apache.org/bugzilla/show_bug.cgi?id=61384>). How do I
get around this? Removing the charset prevents the encoding of the filename,
adding it breaks IIS. I am using httpclient 4.5.11.
Thanks,
Hari.