tags:

views:

97

answers:

2

I want to build a simple file uploading applet in Java. It will be used to upload files to a regular linux web server. So if someone went to:

http://site.com/file-upload-applet

And uploaded a file there via the applet, it will be accessible at:

http://site.com/uploads/your-file.jpg

The user should be able to click 'Browse', and then look through the folders on his computer ,and be able to select as many files, or every file in a folder, if he wanted. Then, when he hits upload, he should be shown a progress bar while the files are uploaded.

Any thoughts about this, and how this could be accomplished in Java as an applet? I will just need some pointing in the right direction, such as which Libraries to use.

+3  A: 

You'd need to have a signed applet, as unsigned applets do not have access to the filesystem.

I found an article about signed Applets.

As for the other components, you'll most likely need a JFileChooser, JProgressBar, and a JButton (that uses Apache HttpClient's PostMethod with a MultipartRequestEntity that wrape the JFileChooser's file in a FilePart).

R. Bemrose
once the applet is signed, how can i show them the browse button to let them pick the file? and how can i show a progress bar? which swing controls do i use, or is there another way?
Click Upvote
I've updated my answer a bit.
R. Bemrose
+1  A: 

I used the Apache Commons File Upload, and it worked like a charm. It took away most of the problems I was worried about, and was very easy to use.

Kieveli