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
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;
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:
Content-Disposition: form-data; name="file";
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?

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