Hi: I have an applet with the following code: String theFile, thePath, theWorkFile; theFile = getParameter("myfile"); thePath = getParameter("mypath"); theWorkFile = thePath + theFile; FileInputStream myStream = new FileInputStream(theWorkFile); I have no problem when I run this locally. The applet is able to read the file. But when it runs from the Internet it does not work. I get the following error: java.security.AccessControlException: access denied (java.io.FilePermission http:\www.mysite.com\mydata.txt read) Read and write are among the file attributes. I have tried many other ways to get this applet to work from my website, but no luck. Can anyone help me with the solution? Thanks, Gabriel
posted 13 years ago
Applets may only access web accessable content (unless you jump through some security hoops)... so you should convert your file path into a URL that points to the file you want and then call the openStream() method on the url. Hope this helps.