SIMPLE: Opening file in applet

I have made an applet that opens file using FileInputStream. I placed this applet and other files onto my web server. Now, when I view my site thru browser it says file security error.

Ques 1. Is it that the applet tries to search for the file to be open, on the client system ?

Ques 2. Should there be any error if I try to open a file residing on web server rather than client thru FileInputStream ?

Ques 3. How should I specify to the applet that the filename specified in InputFileStream is the file on my web server and has to do nothing with client.

Basically, how I can get rid of File Security
Error.
Thanks in advance.
Shishir Saxena
[692 byte] By [Shishir] at [2007-11-15 19:14:20]
# 1 Re: SIMPLE: Opening file in applet
Java has built in security for applets - applets are not allowed to open files(access resources in client m/c) and some others like open a network connection etc.
So by default applets are not allowed to access client resources for security - jvm verify the access to local resources and the security manager is invoked to throw the
exception u see on ur console .There are 2 ways to solve this
1) use signed applets - which grant special permissions for the applet. to create signed applets look for more info on java.sun.com/security for javakey tool.
2 ) if ur using netscape then use netscape capabilities api - look for info in netscape site(developers)

Hope this helps
at 2007-11-10 3:01:24 >
# 2 Re: SIMPLE: Opening file in applet
If u're using File (i.e. the applet is searching on the local host, which its not allowed to). Try instead URLConnection or getResourceAsStream()

EK
YePP at 2007-11-10 3:02:27 >
# 3 Re: SIMPLE: Opening file in applet
I do not want to open any file on client m/c instead, I want to open a file placed on my web server. Actually, I have to read and write contents to that file thru my applet. Will security feature come into picture.
Thanks
Shishir at 2007-11-10 3:03:26 >
# 4 Re: SIMPLE: Opening file in applet
Is it possible to read and write contents to a file on my web server thru the functions U have told. Actually, I want a pointer "is" of type InputStream for that file. Is it possible.
Thanks
Shishir at 2007-11-10 3:04:28 >