• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Permission denied exception on saving file to filesystem

 
Rituraj tyagi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21322
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1111
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic