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