Archived

This topic is now archived and is closed to further replies.

[java] File Access

This topic is 6358 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

I was writing a java applet and I can only seem to access files if I give their absolute paths. This worked on my machine but when I uploaded the applet to the server and the trial data to the same directory, the applet could not find it. I tried doing new File("data") and New File( getCodeBase(), data) and it couldn''t find the file. Help?

Share this post


Link to post
Share on other sites
you can''t access files with applets. The applet is running inside the local browser, but the data files are on the web server. How is new File() supposed to find them? You need to do new URL(), and the name of the server must be the same as where the applet was downloaded from for security reasons.

Share this post


Link to post
Share on other sites