• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multi-part

 
Bob Moranski
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, what is a multipart/form-data request?
Thanks.
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not much fun to deal with, that for certain. If you use an html tag to upload a file, like so,
<INPUT TYPE="file">
then the file you browse to will be be added to the end of the http header when posted. Therefore, you can't do the standard getParameter("name") to retrieve the data. You have to parse the header to find the boundry marker. The information proceding this boundry is the file. For example,
Content-Type: multipart/mixed;
boundary="gc0p4Jq0M:2Yt08jU534c0p"
If you want to get all the details check out O'Rielly's Servlet Programming book. It has a nice multipart discussion and source code for handling it (note that the source is avialable on line at their site if you don't own the book but want to have a look).
Hope this helps
Sean
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic