From: AmarendraR@NIIT.com
To: java-security@web2.javasoft.com
Subject: Applets reading files on originating host
Date: Thu, 15 Jul 1999 10:58:45 +0530
Hi,
Is it possible for an applet, displayed in a browser (Netscape Navigator
3.0 and IE 3.0 -> ) to read a data file off the originating host. I am
trying to
write a Java applet which reads a file from the HTML directory from
which the html file containing the applet tags originates.
I am consistently getting security exception errors. Here the code
resposible for
reading the file content.
URL sector = new URL(getCodeBase()+"sector.txt");
BufferedReader in = new BufferedReader(new
InputStreamReader(sector.openStream()));
The sector.txt is in the same directory where the applet's .class is
residing.
It's failing at the second line in the above code and giving a security
exception.
This applet is running fine in Netscape4.0 and IE 4.0.But failing with 3.0
versions of both the browsers.
Is is possible with 3.0 versions of the browsers.
Please help in getting out of this problem
Look forward for your reply.
Regards,
Amarender Reddy.P
Senior Systems Executive
NIIT Ltd
Kalkaji, NewDelhi
India
Ph: 91-011-6203895