Thank you everyone for your help!  I didn't realize that
request.getParameter("") can't read any params from a multipart/form-data
request.  Is this something that is specific to tomcat, or do you have to
parse out all the parameters on your own for any server?  I guess this might
be the way the java servlet code works.  Funny that there no exceptions or
anything though, it just doesn't display the page.




-----Original Message-----
From: William Kaufman [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 11, 2001 10:36 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Posting "multipart/form-data"


You'll need to package your data in a MIME message.  There may be something
in the O'Reilly package for that; if not, you can use JavaMail, available
at,

        http://java.sun.com/products/javamail/index.html

Look specifically at the javax.mail.internet package, and all the Mime*
classes.

                                                            -- Bill K.


> -----Original Message-----
> From: Bo Xu [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 11, 2001 8:07 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Posting "multipart/form-data"
>
>
> Frans Verhoef wrote:
>
> > One good API for dealing with multipart/form-data is the
> > com.oreilly.servlet package.
> > http://www.servlets.com/cos/index.html
> >
> > I used it myself, and it works really great. And if you
> want to use it
> > commercially, you just need to buy the book of oreilly.
> >
> > Frans
> >
> > On 10 May 2001, at 17:25, Brandon Cruz wrote:
> >
> > > When I try to specify enctype="multipart/form-data", the
> page just goes
> > > blank and IE says that it can't find server.  Anyone know
> why this might
> > > happen?
> > >
> > > Brandon
> > [...]
>
> Hi :-)  I also use multipart/form-data with Jason Hunter's API
> com.oreilly.servlet.MultipartRequest, in the client I use a HTML Form
> from his book:
>
> <FORM ACTION="/servlet/UploadTest"
> ENCTYPE="multipart/form-data" METHOD=POST>
> What is your name? <INPUT TYPE=TEXT NAME=submitter> <BR>
> Which file do you want to upload? <INPUT TYPE=FILE NAME=file> <BR>
> <INPUT TYPE=SUBMIT>
> </FORM>
>
>
> now I have a question:
> now I want to upload a file to MyServlet from a Java
> Application(or a Java
> Applet),
> I guess I need to use (Http)URLConnection, but I don't know
> how to use it:
>
> - how to set ENCTYPE="multipart/form-data"?
> - do I need to read the file into a byte[], then put this byte[] into
> (Http)URLConnection?
>    where/how can I put?
> -...
>
>
> Thanks in advance!
>
>
> Bo
> may.11, 2001
>
>

Reply via email to