Hi, Problem: My servlet has a field which is used to upload files from the local file system. It works when I run it locally. When it's online it gives an error saying "access denied (java.io.FilePermission..". I looked at the java docs and I came out with this line .. FilePermission fp = new FilePermission("<<ALL FILES>>" ,"read"); Having created this file permission object, how then do I use it to grant the permission such that I can read any file from the local system?? Could somebody please help me.
In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
Fortunately, that's not how it works. Java security would not be very secure if you could go around granting yourself permissions just like that To give yourself this permission, you will probably have to modify the security policy file, or get someone else to do it for you. What type of environment are you trying to run the servlet in? An ISP offering servlet/JSP hosting? What privileges do you have? Can't you write the file to another location where you do have file write permissions? - Peter
Okay you got me Peter lol. I use www.jwebhosting.net (please check it out) for my jsp/sevlet hosting. I pay for it. So maybe I will talk to the guys there and they would advise me. For now all I know is that Java will not let you get away with anything...the security sucks if you ask me. lol!