Hi Oleg, thanks for your reply. Problem is solved. It was the problem of the opensource upload servlet. I have written my own Servlet and now it works. I updated tomcat to the newest version, so I can use getParts(), which is much easier to handle.
Regards, Oliver -----Ursprüngliche Nachricht----- Von: Oleg Kalnichevski [mailto:[email protected]] Gesendet: Mittwoch, 22. April 2015 12:45 An: HttpClient User Discussion Betreff: [REDDOXX Spamfinder] Re: AW: MultipartEntityBuilder with special char in filename 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]
