Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Permission Denied" on output of flat file from ASP

Status
Not open for further replies.

webwriter

Programmer
May 18, 2001
18
US
Hi..
I have a survey ASP that I want to capture the results from into a flat file.. WOrks great on IIS.. I transfer the code to my test web server and get "Permission denied" on the file that i'm creating on my web server. no code changes except in location of file. I've had my administrator check all passwords on the folder/web server and they have full rights.. Do you have a clue why i may be getting the "Permission Denied" when CreateTextFile is executed???

Also, I can create a simple text file in the webserver directory and access it.. So, i'm still not sure about where to go. I have checked the permissions on the folder/file that i'm trying to access in my webserver directory...

Thanks.. I could sure use help with this.. !!

Here is a sample of my code i'm using..
============================================================
dim ForAppending

ForAppending = 8

strFileName = "\\xxwebdev\test\CSsurvey.txt"

set filesys = createobject("Scripting.FileSystemObject")

if filesys.fileExists(strFileName) then
set filetxt = filesys.OpenTextFile(strFileName, ForAppending, False)
else
set filetxt = filesys.CreateTextFile(strFileName)
end if
===========================================================
"Permission Denied" happens on "createtextfile" line..

Many thanks everyone...


 
This is almost certainly a permissions problem on your server. I had a very similar problem when I was writting a log file logging the IP of everyone who logged in to a site. Presuming your ISP is NT based, you need to make sure that you're ISP admin has given write access to whichever account IIS uses for anonymous access. When I did that my code worked fine. I think the account is normally IISGuest or something like that.

G -GTM Solutions, Home of USITE-
-=
 
Thanks for the advice... I have no problems with this file on IIS... The problem has occurred after I moved my code to my test webserver (not my IIS). Should I still have the anonymous user set up for my webserver acct as well??

Thanks..
 
I dont know anything about any other platforms, but when this error is generated by IIS its because it does not have NTFS permissions to write to the target directory. The error is being generated by NT rather than IIS. I would guess you would have similar considerations on other OS'. You would certainly have the same problem with other web servers running on NT/2000.

G -GTM Solutions, Home of USITE-
-=
 
Yes, on your production server as well. The production server is also running IIS. Like Geee said the anonymous access account must be setup to allow write permissions to the directory your trying to create the file in. The only problem is, a lot of Web Hosting companies won't allow this permission to be setup for the anonymous account but check with them who knows what they'll say.

David Capone
Web Developer
Windows 2000 Server Admin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top