Newbie question

JeromeQc
JeromeQc used Ask the Experts™
on
Is it possible to access a txt file for reading and writing with an applet? I think I once read that we cannot access the disk with an applet for security reasons. I'm a little confuse, is it possible or not?

Thanks in advance
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Yes it is possible. The security restrictions kick in when you attempt to read and write from the disk of a remote computer. It can, however, read and write to your disk just fine, at least it can when it is running in the appletviewer.

Commented:
More specifically, an applet can access the file system of the computer on which it originated. So, if you're running it from your local computer, it can access the local files. But if it has been loaded up in a browser from some remote computer, it can only access the files on that remote computer; not your local files.
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Mick BarryJava Developer
Top Expert 2010

Commented:
>  it can only access the files on that remote computer

And how will it access files on remote computer :-)
Mick BarryJava Developer
Top Expert 2010

Commented:
For an applet (that isn't loaded from your local disk) to access files on the local disk it needs to be granted permission by the user. This requires that the applet be signed, or if using the plugin by the user modifying their security policy file.

Author

Commented:
Thanks a lot

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial