"request was rejected because no multipart boundary was found" while using httprequest
4,593 views
Skip to first unread message
rakesh
unread,
Oct 29, 2008, 4:32:08 PM10/29/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Gears Users
I hav a simple code that attempts to use Desktop for multiple file
upload to a server(a simple file upload servlet hosted on jboss and
written using apache-file-upload).
Once I open the request,
this is how I set it to be multiplart content:
request.setRequestHeader("Content-type", "multipart/mixed");
On the server I get the following exception:
org.apache.commons.fileupload.FileUploadException: the request was
rejected because no multipart boundary was found
Am I missing something in the header? all help appreciated!!!
Michael Nordman
unread,
Oct 30, 2008, 3:11:41 PM10/30/08
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to gears...@googlegroups.com
Looks like you are trying to emulate a typical form post. The content type typically used is multipart/form-data. The full content type header also needs to indicate the boundary used within the post data to delineate the different parts... here's some pseudo code.
string sCRLF = "\r\n"; string sDashes = "--"; string sBoundary = "some dashes and numbers and letters that does not occur in element names|values|filedata";
string sMultipartContentType = "multipart/form-data; boundary=" + sBoundary;