Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file uploader applet

Status
Not open for further replies.

harmmeijer

Programmer
Mar 1, 2001
869
CN

point 3 and 11 say that an applet running in a browser cannot read from a file from the client's disc or start another programm on the client's machine.
Sure this is a verry strong securety setting (unlike active x) but like active x you can enable it for "trusted" sites (in IE).

Does anybody know how to write a file uploader applet that uploads files from the client harddisc to the server that the applet originated from? (using URLConnection POST).

I thought this could come in handy when a user wants to drag and drop a list of files on the applet and let the apllet upload the files (and use some compression before uploading).

I was thinking of creating a swing app that does this but it should run as an applet or the applet should start this app and it looks like that won't work.



Greetings, Harm Meijer
 
You dont need an applet to upload files from client to server. It can be done in a browser using the <input type=file> tag.
 
Hmmm, as far as I know <input type=file does not allowe the user to drag and drop entire folders on it.
Nor does it provide any way to set the value programatically (there is a way to set a value but the container of the html file (IE) does not allowe it).
The first option is too bad, I am happy the value of the input type file cannot be programmed though as this would make the Internet a whole lot less popular.

I have found that I have to sign the applet to allowe it to read from files. Then do set a policy for those signed applets:



Greetings, Harm Meijer
 
I realise you cannot drag-and-drop using the file input tag. But considering the extreme expense to a user of downloading an applet, making sure it works, getting through a firewall, making sure applets are allowed to be viewed, setting the security policies and so on, I reckon its easier to use the built-in browser methods. Most of the companies we operate with won;t even let an applet through their firewall ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top