title: How to extract Data from a multipart Http Request?
body: <p>I am writing a HTTP Webserver. My server has to handle Http multipart requests. In my previous implementation, I was extracting the data with the help of content length header present in every part of request. The client which I was using give content-length header with every part part(file) in the multipart request.</p>
  
  <p>But another client is not giving content-length of each file. In my implementation I use content-length header to extract that much bytes and save them into a file.</p>
  
  <p>Please tell me how can I extract data now.</p>
  
  <p>The Headers which I am getting now are:</p>
  
  <pre><code>POST xxxxxxxxxxxxxxxxxxxxxxx&amp;currentTab=PHOTOxxxxxxxxxxxxxxxx HTTP/1.1
  Content-Length: 6829
  Content-Type: multipart/form-data; boundary=SnlCg9JqTpQIl6t_mPzByTjZ8bD24kUj; charset=UTF-8
  Host: host
  Connection: Keep-Alive
  User-Agent: Apache-HttpClient/xxxxxxxx
  Accept-Encoding: gzip
  
  --SnlCg9JqTpQIl6t_mPzByTjZ8bD24kUj
  Content-Disposition: form-data; name="file"; filename="imagesCA5L2CL6_jpg(2)_jpg.jpg"
  Content-Type: photo/jpg
  
  **Some Data byte array**
  --SnlCg9JqTpQIl6t_mPzByTjZ8bD24kUj--
  </code></pre>
  
  <p>In this request, there is now content-length header in part data.</p>
  
  <p>EDIT:</p>
  
  <p>Earlier this client used to send content-length header in every part. But for some reason it is not sending it any more. Can anybody suggest any reason for that.</p>
  
  <p>thanks</p>