File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Setting File Permissions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Setting File Permissions" Watch "Setting File Permissions" New topic

Setting File Permissions

Bindesh Vij

Joined: Oct 27, 2004
Posts: 23
Dear All,

I tried the code from Leonid Dukhvalov [see thread File Upload problem]. But iam not able to write file to my web app directory in tomcat. I read the server documentation and it specifies that by default only read permission is enabled. How to setup write permission for a given web application

thnx in advance
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Seems more appropriate for the Servlets forum.

[Asking smart questions] [About Bear] [Books by Bear]
Bindesh Vij

Joined: Oct 27, 2004
Posts: 23
I read the Tomcat server doc again..
What i could make out is there has to be an entry into the web.xml.. but iam really confused with it...

pls. help
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
I think we need more information - which operating system are you using? Write permission could be an operating system setting.
Exactly what is the text of the Exception or Error that you get when you try to write a file - frequently the text can lead you right to the problem.
Exactly how do you construct the name used to open the file?
Bindesh Vij

Joined: Oct 27, 2004
Posts: 23
Thanks for the reply..

I am using win2k ..Tomcat 5.1.. Iam getting the following error

HTTP Status 404 - D:\JSoft\Tomcat 5.0\webapps\WebServlet (Access is denied)

type Status report

message D:\JSoft\Tomcat 5.0\webapps\WebServlet (Access is denied)

description The requested resource (D:\JSoft\Tomcat 5.0\webapps\WebServlet (Access is denied)) is not available.

i am using Commons File Upload..the code is

thnx ...
[ November 02, 2004: Message edited by: Bindesh Vij ]
I agree. Here's the link:
subject: Setting File Permissions
It's not a secret anymore!