We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › inputFile() error
Page Index Toggle Pages: 1
inputFile() error (Read 1337 times)
inputFile() error
May 15th, 2005, 3:05am
 
Hellooo,
I'm still suffering from inputFile() problem!
When I use inputFile() in PDE, it works, but when I export it and load from a brower it doesn't work. The following is error message in a Java console.

java.security.AccessControlException: access denied (java.io.FilePermission **** read)

And sometimes it freezes also..

I'm using OSX Tiger, and as I know there might be no problem in permission setting.

Thanks for any help!
Sou
Re: inputFile() error
Reply #1 - May 15th, 2005, 3:38am
 
java (and therefore processing as well) has a security model called sandbox. this restricts what can be done when run as an (unsigned) applet. one of the things not allowed is to read files from the client (browser) side. you don't want applets snooping around your computer, right?
( http://java.sun.com/j2se/1.4.2/docs/guide/security/spec/security-spec.doc1.html )

an (unsigned) applet can (!) read from the host it came from and from inside it's jar. so, if you are trying to read in a file you pass along with your applet, just put them there. in fact the best place for such a file would be inside the data-folder inside your sketch-folder (create it if it's not there), because then it's being put into the .jar when you export your applet.
( see:  http://processing.org/reference/loadStrings_.html  )

a signed applet can overcome some of the restrictions from the sandbox. if you need to have the applet open files on the client-side, then see the link for instructions on how to sign your applet.
( http://stage.itp.nyu.edu/~sve204/wiki/wiki.pl?SigningAnApplet )

F
Re: inputFile() error
Reply #2 - May 15th, 2005, 5:37am
 
Thanks, fjen Smiley

I've finally found it's not the problem of inputFile() in this case.
In my work, I'm passing loaded file to AudioInputStream class, and that part of my code causes problems. I'd better to read the pages you've mentioned.

But even in case when I use only inputFile(), it doesn't work in Firefox and in Safari it freezes once in a while.

Actually my work at the moment is writing some classes for audio analysis, and I'd like to make users choose a file from her/his own local machine. Thus I've made a button to load a file, and so far it doesn't work properly.

If there is any suggestion for this work, I'll be very happy Smiley

Thanks,
Sou
Re: inputFile() error
Reply #3 - May 15th, 2005, 1:37pm
 
where does inputFile() come from? is that part of a library?

F

<< sorry .. forget it, found it ... >>
Page Index Toggle Pages: 1