hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nir Dweck <n...@vasco-de.com>
Subject receiving a multipart entity at a http server
Date Tue, 09 Apr 2013 13:37:52 GMT
Hi,
I am trying to receive a multipart entity at my http server and am having
trouble to parse it.
The request includes a header:
Content-Type: multipart/form-data;
boundary=-------------------------acebdf13572468
my code does the following:
BasicHttpEntity entity = (BasicHttpEntity)entityReq.getEntity();
long len = entity.getContentLength();
byte[] data = new byte[(int)len];
int read = entity.getContent().read(data, 0, (int)len);

and when I look at the the read bytes they hold:
includes a BasicHttpEntity and when I read it I see the content is:
---------------------------acebdf13572468
Content-Disposition: form-data; name="file";
filename="Data-Did_2013-03-03_06-05-15-6352000_Fid_114.plf"
Content-Type: application/octet-stream

‰

I actually need the bytes in the sent file.
Can someone send me a short code example on how to do it?
Regards,
Nir

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