John-

You might want to check out the org.apache.util.multi package
that I contributed to the Java Apache Project. It's a set of
three classes that facilitate handling of multipart/form-data
requests. Take a look at http://java.apache.org for more info;
you'll want to go to the webcvs system and take a look at the
jserv_utils module.

(Although the code is part of the Java Apache Project, it should
work with any servlet engine. I've only tested it with Apache
JServ though.)

-Greg-


>I'm looking for sample code on handling multipart/form-data.
>For instance, consider the following form.
>
><form method=post action=myservlet enctype="multipart/form-data">
><input name=description type=text>
><input name=myfile type=file>
><input name=submit type=submit>
></form>
>
>I want myservlet to extract the name, description, mimetype, etc.
>of the file for storage in a database.  And then I want to extract
>the contents of the file and store it on the server in its original
>form (e.g. not mime encoded).
>
>I tried the usual getParameter... methods and they return nothing.
>I'm guessing since the data is not arriving in the usual
>application/x-www-form-urlencoded form.  Unfortunately, I don't
>seem to be able to find analogous methods for multipart/form-data.
>
>Please help.
>
>Thanks,
>John
>
>___________________________________________________________________________

>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body

>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to