This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • 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
Pie
Posts: 20750
30
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: 1110
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