PDA

View Full Version : Java Question !!



Mba7eth
February 10th, 2007, 12:14 AM
Hi all , I need some help in the following !!

I'm designing an applet i'm done with it but the problem is i cant open the applet from a browser becuase this applet is trying to open a file and the broswer doesn't give the premission to open the file .... So anyone any help ... How to get around this problem ?

Engnome
February 10th, 2007, 12:40 AM
Applets cannot read/write files on the computer it's running on. Security reasons. They should be able to read from the server though. Exactly what are you trying to do? You are being very vague...

laxmanb
February 10th, 2007, 04:52 AM
there's a program called "policytool" which comes with the JDK...

type policytool @ the command prompt/terminal...

you have to make a new policyfile that allows the applet access to files...

Mba7eth
February 10th, 2007, 05:22 AM
Engnome , Sorry for my bad english 8-[ .
I want the following :
what i want is how to open a file thru an applet ?


I going to try policytool laxmanb :-k

David Mulligan
February 10th, 2007, 06:22 PM
If it is read-only why don't you host the file on the server?

The problem with altering the security policy on the client machine is that everyone who wants to run the applet will have to do that. I for one am glad that applets cannot access or modify files on my computer.

Mba7eth
February 11th, 2007, 01:02 AM
hmmmmm .... Yes it is a read only. I guess what you mention is going to be the solution.
One more Question :
If i added this file to the jar file can i open it on my local box. I have tried but I really couldn't.