How can I write/read files using servlets, without getting java.io.FileNotFoundException: file_name(Permission denied).

Darren Hobbs

First, remember that servlets run on the server-side, and therefore only have access to the file-system of the server. They cannot directly interact with clients, except through HTTP request/response.

It could be that the servlet does not have sufficient permissions to write to the file-system (which itself depends on what permissions the servlet container process has).

Try explicitly specifying the full path to a directory that you know has full 'global' read/write access permissions.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact