Accessing a local file
2 posts in topic
Flat View  Flat View

Posted By:   Imran_Masud
Posted On:   Monday, June 25, 2001 05:38 PM

I have made an applet and put it on the web.
It asks the user to enter his student number.
After that it opens a frame which opens a local file and then
search for his marks. If I run locally,
it works but not on the web.
When I put it on the web, it trys to open the file from the computer
on which it is running (which is not allowed). How can I fix that so it would open the file from my computer.

Thank you

Re: Accessing a local file

Posted By:   John_Zukowski  
Posted On:   Thursday, June 28, 2001 01:44 PM

Breaking out of the Java sandbox to access the local file system is already covered in the FAQ.

Re: Accessing a local file

Posted By:   Abdul_Habra  
Posted On:   Monday, June 25, 2001 07:18 PM

An applet, by default can not access the local disk files. The applet runs inside a "sand-box" that prevents it from accessing many computer resources.

If you must access a local file, there are two main options:

1. Certificates.

2. Policy file.

Each has its pros/cons.

Both are documented at Sun's web site.
Also, there is a quick introduction to working with policy files at:

About | Sitemap | Contact