Create/Modify Files (ASP.NET)

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
I'm getting an error

Access to the path "/home/neckelma/www/maps/N164RJ TXKF-LFTH.kml" is denied.

when I run the coding
Code:
Return XmlTextWriter.Create("/home/neckelma/www/maps/" & strFileName, xmlSettings)

strFileName obviously holds "N164RJ TXKF-LFTH.kml".

The file causing the error is Default.aspx & I've set permissions 755.

Can anyone tell me what I'm doing wrong?
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
The permissions on which file are 755? Default.aspx? It doesn't need execute permission because it isn't directly executed. The maps directory, however, needs to give write access to the web server process's user. Try temporarily giving maps the mode 777, but don't leave it that way otherwise every local user can create and delete files from that directory. If that works, you know where the problem lies. A secure solution would be to change the group for maps to a group that the web server process is a member of and give maps the mode 775.

As the web server should run under your account, I suspect the problem isn't file permissions.
 

sneckelmann

New Member
Messages
19
Reaction score
0
Points
0
Thanks. Giving the maps directory 775 worked. Everything else is set to 644.

I'm not much on the admin side of things. More into the programming.

Thanks again.
Edit:
Oops! I take it back...

Correct permissions had to be set to 645.
 
Last edited:
Top