This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: My Servlet has no permission to upload files...please help