wood burning stoves 2.0*
The moose likes Applets and the fly likes Applet can't write to the file, Permission denied Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet can Watch "Applet can New topic
Author

Applet can't write to the file, Permission denied

Mouza Ali
Ranch Hand

Joined: Oct 28, 2008
Posts: 39
Hi,

I always get back to this great forum. I have a problem with the Applet. I build a Java Applet that when a button is pressed, some java classes in eclipse will create a file and then the Applet should be able to write to this file. But it seems that there is a java.io exception, where it says: permission denied on /home/mouza/public.xml write!

I tried changing the permission of the Applet class to u=rwx and let the applet sets the file permission using java too, but also didn't work!

How can I solve this prob?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
By default, applets can't access the local file system as a security precaution. The HowCanAnAppletReadFilesOnTheLocalFileSystem page explains how to get around that.


Ping & DNS - updated with new look and Ping home screen widget
Mouza Ali
Ranch Hand

Joined: Oct 28, 2008
Posts: 39
Thanks,

When I was googling, I found that I have to sign the applet, but getting arround not buying a certificate from thawt is the issue now.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39576
    
  27
For development you can use a self-signed certificate.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet can't write to the file, Permission denied
 
Similar Threads
signned applet on JVM 1.4.2
java.policy file - PropertyPermission ???
policy file
Writing to a file
Changed was.policy to allow writing to file and didnt work