2

Basically, the following is what the format of data look like (it should follow HTTP standard format)

Content-Type: multipart/form-data; boundary=--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f

--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f
Content-Disposition: form-data; name="foo1.jpg"; filename="foo1.jpg"
Content-Length: 5578
Content-Type: image/jpeg

<image data 1 omitted>
--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f
Content-Disposition: form-data; name="foo2.jpg"; filename="foo2.jpg"
Content-Length: 327
Content-Type: image/jpeg

<image data 2 omitted>
--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f--
tom
  • 14,273
  • 19
  • 65
  • 124

1 Answers1

1

You can take a look at this question which recommends using Apache Commons File upload

Community
  • 1
  • 1
Manish
  • 3,913
  • 2
  • 29
  • 45
  • Thanks for the pointer, unfortunately, HttpServletRequest is not exposed by Play! framework that has my web service hosted. – tom Nov 17 '11 at 07:41
  • 1
    Apache Commons File Upload also includes classes for lower level processing (eg inputstream), so you might be able to use those. – Mark Rotteveel Nov 17 '11 at 11:02
  • Take a look at Play Framework 1.2.x source, they actually use Commons FileUpload to provide the users the form-data parts, and as @MarkRotteveel mentions you can find examples to read the data from a InputStream backed up by your body string data – Jaime Hablutzel Mar 07 '13 at 22:32