I would like to be able to read the contents of a .zip file placed on a server from within an applet.
Currently the code below...
Reads the contents of somezip.zip (code and zip file on desktop) and adds it to the 'text' String. But when I try it from applet(both on server), I get 'access denied (java.io.FilePermission somezip.zip read)'
Is there any way to fix this, without using signed jars, or policy files.
Thanks for any help. [ May 08, 2007: Message edited by: colin shuker ]
The code you have is trying to read from local disk on the browser user's PC. That is forbidden for applets unless you set up the security policy file. But that isn't really what you want to do, is it?
To get files off the server you'll have to use HTTP. Your applet can use an HttpUrlConnection to GET a file from the server. I'd expect the server to extract one file from a zip and return it to the applet. Does that sound right to you?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
posted 13 years ago
Thanks for fast reply, I still have no idea how to do that though. I guess you are right though, the applet is searching on the pc for the file.
But when the applet has to load images on the server to use, it uses a class loader..
I'm not sure if that would come into it, when trying to load a zip.
Thanks for any advice.
get schwifty. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop