multiple file upload?

N

news.amnet.net.au

Hi

Is there a way in Java to upload several files at once? I would like a
"browse for files" window to be initiated from IE or Netscape, so that the
user, by holding down the SHIFT key, can select several files at once in
that "browse" window. All the selected files are then uploaded, perhaps
into an ArrayList.

Note that the usual way for opening a browse window <INPUT TYPE=FILE
NAME=SOMENAME> is no good as this does not seem to allow for several files
to be selected at once. So perhaps this can be done with java code in a jsp?

I actually do not need the content of the files, just he paths and the
filenames, loaded into an Arraylist or perhaps a Vector.

Is there a way of doing this in Java?

A pointer to APIs or a code example would be highly appreciated.

Thanks very much

Hugo



..
 
A

Andrew Thompson

news.amnet.net.au said:
Hi

Is there a way in Java to upload several files at once? I would like a
"browse for files" window to be initiated from IE or Netscape, so
that the user, by holding down the SHIFT key, can select several
files at once in that "browse" window. All the selected files are
then uploaded, perhaps into an ArrayList.

Note that the usual way for opening a browse window <INPUT TYPE=FILE
NAME=SOMENAME> is no good as this does not seem to allow for several
files to be selected at once. So perhaps this can be done with java
code in a jsp?

It can be done in HTML if you get lateral..
<INPUT TYPE=FILE NAME=SOMENAME1>
<INPUT TYPE=FILE NAME=SOMENAME2>
<INPUT TYPE=FILE NAME=SOMENAME3>
.....
 
C

Chris Smith

news.amnet.net.au said:
Is there a way in Java to upload several files at once? I would like a
"browse for files" window to be initiated from IE or Netscape, so that the
user, by holding down the SHIFT key, can select several files at once in
that "browse" window. All the selected files are then uploaded, perhaps
into an ArrayList.

For any Java applet to present a file dialog box would require that it
be privileged. Once you get over that hurdle, this isn't hard at all.
A pointer to APIs or a code example would be highly appreciated.

java.awt.FileDialog or javax.swing.JFileChooser
java.net.URLConnection to send the results

And, of course, see any tutorial on applet signing.

--
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top