hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olaf Scheidt <Olaf.Sche...@werum.de>
Subject AW: MultipartEntityBuilder with special char in filename
Date Tue, 21 Apr 2015 16:18:11 GMT

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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message