aspose file tools*
The moose likes Servlets and the fly likes Permission denied exception on saving file to filesystem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Permission denied exception on saving file to filesystem" Watch "Permission denied exception on saving file to filesystem" New topic
Author

Permission denied exception on saving file to filesystem

Rituraj tyagi
Greenhorn

Joined: Oct 06, 2009
Posts: 13
Hi All

I was trying to save an uploaded file at the location where application(war) is deployed on tomcat server(free hosting plan) by trying getServletContext().getRealPath() but it returned null instead of path but this worked on local machine . Than I tried to save files to local filesystem on server (let us suppose /var/tmp/../file/) but it thrown an exception Permission denied even though the server gets the locations write and read permissions as true . Below is the code:-



I doubt that the problem is with the security policy of the hosting service but not sure . So guys can you please suggest on this.

Thanks in advance

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18132
    
    8

Rituraj tyagi wrote:I doubt that the problem is with the security policy of the hosting service but not sure


Quite likely the hosting service does have a security policy which prevents you from using their disk space. Does your contract with the service mention that?
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1106

Paul Clapham wrote:
Rituraj tyagi wrote:I doubt that the problem is with the security policy of the hosting service but not sure


Quite likely the hosting service does have a security policy which prevents you from using their disk space. Does your contract with the service mention that?

especially as it is free
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Permission denied exception on saving file to filesystem
 
Similar Threads
take in file from client machine
Unable to upload file using Swing and Servlets to Server
request.getParameter() returning null
Submit multipart and form data
Eclipse fileupload no longer works