Accessing local files on the client

I understand that applets cannot access local files from the client system. This would be because of the security issues.

But even HTML provides Form-based File Upload, where the user is allowed to browse a file in his local system using the FileDialog and upload it.

Doesn't applet have any feature where a similar thing is possible?

=> My applet would open up in the browser, the user clicks a button on the applet that gives him a file open dialog, he browses his local file system for the file, and after he selects the file, the applet will read the content of the file using any stream class.

I don't want the applet to be given any extra permissions to do this because

1. The interaction with applet should be seamless

2. HTML already supports this feature

3. The user is himself agreeing to upload the file by selecting it.

Thanks,

Praveen

[913 byte] By [koosalaa] at [2007-11-27 6:06:40]
# 1
You need to give the applet permission by signing it. I do not think there is any other way around the security issue.Look at the tutorial: http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html
burferda at 2007-7-12 16:22:35 > top of Java-index,Desktop,Core GUI APIs...
# 2

But you are missing the point again. By signing the applet, I would be giving extra permissions to the applet.

HTML internally allows for people to upload files to the server. Imagine every mail provider like Yahoo and Gmail needing to have a workaround scaring people with the security permissions they would need before you could attach a mail.

Even the .NET framework 3.0 allows for building applications similar to the applet (XBAP is the .NET lingo) and it specifically makes provision for this. I am surprised there is nothing similar in Java applets.

koosalaa at 2007-7-12 16:22:35 > top of Java-index,Desktop,Core GUI APIs...
# 3
hi!have you gone through the entire document. just read it with a bit more patience and you will find what you are looking for. > I am surprised there is nothing similar in Java applets.do not be, study about all the features it have.regardsAniruddha
Aniruddha-Herea at 2007-7-12 16:22:35 > top of Java-index,Desktop,Core GUI APIs...
# 4
HiI think you answered your own question when u said....."he selects the file, the applet will read the content of the file using any stream class."Reading a file from a client comp needs permissionHTHSmilies all round:) :) :) :)
monk3ya at 2007-7-12 16:22:35 > top of Java-index,Desktop,Core GUI APIs...