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 1

Status
Not open for further replies.

webwriter

Programmer
May 18, 2001
18
US
Hi..
I have a survey ASP/VBScript 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 will be due to the settings on the web server. You will need to pass trusted connection string as part of the process because the general web visitor account doesn't have the correct permissions to enable file creation. Speak to the web server admin people again.
 
Hi..
I'm sorry to sound clueless, but i'm not sure i understand what you are saying.. could you please pass an example to me to make sure i'm understanding what you say I should do..

Many thanks..
 
If your web server is running on IIS there will be an Internet Guest Account [IUSR_SERVERNAME] configured for anonymous access. This is the account that Windows assigns to any web user who is simply browsing pages on your web site. By default Windows does not allow write permissions to this account, so your script (which is probably running under the IUSR_SERVERNAME account) is failing to write to a new file (the .CreateTextFile command).

The best way forward is to speak to the web server admin guys and ask them to either allow write permissions in your directory only, or to set up an additional account (in Active Directory Users - Win2K) for you to use. If they do the latter they will tell you how you can connect to the new account.

Hope this explains a little more,

Chris.
 
Thanks Chris..

I'll give this a try with the admin guru and we'll see what happens.. I think we have determined that a difference may be that my local machine runs IIS 5.0 on Win 2K and the webserver is IIS 4.0 on Windows NT... It is the version 4.0 where i'm having the problems.. Thanks for the info. I'll see if i can solve this soon..

many thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top