Sign in to follow this  

My signed java applet wont let me write files, what to do?

This topic is 4687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I've made an applet to write files, it runs fine in applet viewer, but when I try to run it on a webpage i get:
Quote:
java.lang.Exception: java.security.AccessControlException: access denied(java.io.FilePermission c:\temp\savefile.txt write)
I have signed the jar file that the applet resides in, so I have no idea what to do. Any ideas? If you need anymore information, let me know, thanks

Share this post


Link to post
Share on other sites
Default security settings? I mean, it would be kind of messed up if random jav applets had full control on my system, and thus be able to trash my HD.

The obvious solution is to either find a work around(Such as not storing files) or convince the user in overriding the security settings and providing them with a possible security breach.

Toolmaker

Share this post


Link to post
Share on other sites
well its a work thing, so the user's know where its coming from...unless someone hacks it, then im in trouble :)

But there was a java example, where it actually writes to your hd. But I can't work out how they did it, because they didn't list anything on how they did it really.
the applet


heres where i got it from, but i still dont get it
Java Development Kit (JDKTM) 1.1.x - Signed Applet Example

Share this post


Link to post
Share on other sites
Quote:
Original post by johnnyBravo
well its a work thing, so the user's know where its coming from...unless someone hacks it, then im in trouble :)

But there was a java example, where it actually writes to your hd. But I can't work out how they did it, because they didn't list anything on how they did it really.
the applet


heres where i got it from, but i still dont get it
Java Development Kit (JDKTM) 1.1.x - Signed Applet Example



I am betting that your computer has been set to let applets write to the hd.
you could just have a normal java program, and let the user download it.

Share this post


Link to post
Share on other sites
nah it has to be a webpage.

With that duke applet, I said 'yes' on the little security message, and it wrote a file to my desktop with a message in it.

So I know its possible, but I just can't work out how

Share this post


Link to post
Share on other sites
oh they give you the source for that class :), but that isn't where the problem is, you have to run a bunch of commands on the jar file that the .class is stored in, and sign/set keys etc. I thought I'd pretty much done all that, but still mine doesn't work, but theirs does!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I think you actually do have to change some stuff in the .java files.

Google around for info on the SecurityManager class.

Should be what you need.

Share this post


Link to post
Share on other sites

This topic is 4687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this