Thanks for the feedback.
But in my application, I do not know how many files the user want to upload
and I would like to allow them upload as many as they like. So I can not
set many <INPUT type="file" .... > because I do not know how many the user
may need.
Is there a better way to save the selected files in somewhere and allow the
user to select another one. When they done, upload all the selected files at
once when the user hit submit button?
Thanks
James
----- Original Message -----
From: Bragg, James <[EMAIL PROTECTED]>
To: James Lee <[EMAIL PROTECTED]>
Sent: Tuesday, August 22, 2000 5:47 PM
Subject: RE: How to upload more than one files at the same time?
> If is true that you can only upload one file for <INPUT type="file" ....
>,
> but you can have multiple INPUTs of type file.
>
> <INPUT type="file" name="file1">
> <INPUT type="file" name="file2">
> <INPUT type="file" name="file3">
> .. .. ..
> <INPUT type="file" name="fileN">
>
> -------------------------------------------------------------------------
> James C. Bragg
> Senior Software Consultant
> Computer Associates International Inc
>
>
> > -----Original Message-----
> > From: James Lee [SMTP:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 22, 2000 5:27 PM
> > To: [EMAIL PROTECTED]
> > Subject: How to upload more than one files at the same time?
> >
> > It seems the <INPUT type="file" name="files"> can only upload one file
at
> > a
> > time .
> > How to upload more than one files at the same time?
> >
> > Thanks!
> >
> > James
> >
> >
> > ----- Original Message -----
> > From: guillaume ORIOL <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, August 22, 2000 5:58 AM
> > Subject: Re: File upload..
> >
> >
> > > Do you now the way I can put a value in the <INPUT type="file"...>
> > field?
> > >
> > > > Hi,
> > > > first of all you should use ENCTYPE="multipart/form-data"
> > METHOD="post"
> > in
> > > > your FORM. If you have the following form:
> > > >
> > > > <FORM action="http://server.com/cgi/handle"
> > > > enctype="multipart/form-data"
> > > > method="post">
> > > > <P>
> > > > What is your name? <INPUT type="text" name="submit-name"><BR>
> > > > What files are you sending? <INPUT type="file" name="files"><BR>
> > > > <INPUT type="submit" value="Send"> <INPUT type="reset">
> > > > </FORM>
> > > >
> > > > and you type Larry and choose file1.txt your user agent will send
back
> > to
> > > > the server the followings:
> > > >
> > > > Content-Type: multipart/form-data; boundary=AaB03x
> > > >
> > > > --AaB03x
> > > > Content-Disposition: form-data; name="submit-name"
> > > >
> > > > Larry
> > > > --AaB03x
> > > > Content-Disposition: form-data; name="files";
filename="file1.txt"
> > > > Content-Type: text/plain
> > > >
> > > > ... contents of file1.txt ...
> > > > --AaB03x--
> > > >
> > > > So you have to:
> > > > -use getHeader("Content-type") with somme processing to retrieve the
> > > > boundary(AaB03x in our case)
> > > > -use getInputStream() to obtain the stream containing de request
data.
> > > > -retrieve the content of the file from the stream using boundary
> > value.
> > > >
> > > > Maybe you don't have to work so hard if your server has already
somme
> > > > classes for doing all this stuff.
> > > >
> > > > Bye
> > > >
> > > > -----Original Message-----
> > > > From: A mailing list for discussion about Sun Microsystem's Java
> > Servlet
> > > > API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> > > > Sushant Kumar
> > > > Sent: Monday, August 21, 2000 4:46 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: File upload..
> > > >
> > > >
> > > > Hi all..
> > > >
> > > > I am trying to upload a file to my server using Form. I am setting
one
> > of
> > > > the the input's type as File. But, on the servlet side I couldn't
find
> > any
> > > > method to read the request's data as file..
> > > > does anyone has any idea about how to do this?? I am using
web-server
> > > > provided with jswdk1.0.1.
> > > >
> > > > Regards,
> > > > Sushant
> > > >
> > > >
> >
__________________________________________________________________________
> > _
> > > > 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
> > > --
> > > Guillaume ORIOL
> > >
>
> --------------------------------------------------------------------------
> > ----------------------------
> > > The information contained in this email is privileged and
confidential,
> > > intended only for the use of the individual or entity to whom it is
> > > addressed. If the reader of this email is not the intended recipient,
> > > you are hereby notified that any dissemination, distribution or
copying
> > > of this email is strictly prohibited. If you have received this email
in
> > > error, please notify the sender immediately by email and delete this
> > > email. Any views expressed in this email are those of the individual
> > > sender unless the sender specifically states otherwise.
> > >
> > >
> >
__________________________________________________________________________
> > _
> > > 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
>
___________________________________________________________________________
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