i am using jersey 1.0.3 and currently getting an exception when i try to
handle multipart form data. i've tried several approaches, but the
preferable one was:
@POST
@Path("add")
@Consumes("multipart/form-data")
public Response add(@FormParam("file") final InputStream input)
{
however, i never get to the method due to this exception:
com.sun.jersey.api.container.ContainerException:
javax.mail.MessagingException: Missing start boundary
at
com.sun.jersey.server.impl.model.method.dispatch.MultipartFormDispatchProvider.processForm(MultipartFormDispatchProvider.java:91)
at
com.sun.jersey.server.impl.model.method.dispatch.FormDispatchProvider$FormParameterProvider.getInjectableValues(FormDispatchProvider.java:108)
* snip *
Caused by: javax.mail.MessagingException: Missing start boundary
at javax.mail.internet.MimeMultipart.parsebm(MimeMultipart.java:713)
at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:383)
the HTML form i'm using to post the data is just a regular file upload form
(i assume this is okay?):
<form method="post" enctype="multipart/form-data" action="<url>/add">
<input value="file" id="file" type="file">
<p></p>
<input type="submit" value="Upload">
</form>