On Tue, 2015-04-21 at 16:18 +0000, Olaf Scheidt wrote:
> Hi Community
>
> How can I send a thumbail with percent char in Filename e.g. a%02.jpg.
> Percent is removed at the destination. a%02.jpg=>a02.jpg
>
> File filename=new File("/tmp/a%02.jpg");
> HttpPost post = new HttpPost(url);
> MultipartEntityBuilder mpe = MultipartEntityBuilder.create();
> mpe.setCharset(Charset.forName("UTF-8"));
> mpe.addBinaryBody("fileData",filename,ContentType.create("image/jpeg"),filename.getName());
> post.setEntity(mpe.build())
>
> Regards,
>
> Oliver
Oliver
Percent sign should be legal for file names. You can try encoding the
file name with q-printable or base64 codecs but there is no guarantee
the server would be able to decode it correctly.
For more complex scenarios involving MIME consider using Apache Mime4J
instead of HttpMime.
https://james.apache.org/mime4j/
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]