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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Upload Error 2

Status
Not open for further replies.

jennuhw

MIS
Apr 18, 2001
426
0
0
US
Server A is my web server running Server 2003 and IIS 6. Server B is my file server running Server 2003 also. I have a script that is suppose to create a file on server B. I have followed MS's article 197964 to create the IUSR and IWAM accounts on server B and gave both of them the appropriate permissions. I also read to create a virtual directory pointing to a share of the same name on the file server. I have also gone to the point of creating a new domain user and giving them the proper permissions to the folder on server B, and I also used the connect as option and entered this user's information. I am still getting permission denied errors. I have the file path writing to the upload page, and it is correct. I have tried all of these with about every configuration that directory security has to offer in IIS. Any other ideas?

Here is my error:

Execution ended: 2/9/2005 4:05:33 PM1219.doc
\\esp10\drawingdbfiles$\test\1219.doc

Microsoft VBScript runtime error '800a0046'

Permission denied

/drawingdb/upload.asp, line 170

Here is the line that causes the error:
set fle = fso.CreateTextFile(server.MapPath("drawingdbfiles/test/" & FileName))


Thanks!
 
Can you try it using the administrator account for Server B??? There is no need to buy another hard drive,...we'll get this to work...
 
I just tried the local admin for that server. Still the same error. I have tried the domain admin also. You are much more patient than I am!! Thank you so much for your help. I have been still searching on Google, but about everything I have found points back to stuff I have already done.
 
Wow..thats weird...that for sure should have worked. Here is the code I used...I mapped a drive P: to my file server and used an administrator account from that server and everything worked.

<%
Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
Set MyFile = ScriptObject.OpenTextFile("p:\test\myfile.txt", 8,true)
%>

 
Okay, I tried the open text file like you did with this line:
set fle = fso_OpenTextFile("h:\test\x.txt", 8, true)
I created the text file, and I am getting the same error message path not found. H is mapped on my web server to the share.
If I change the line to this:
set fle = fso_OpenTextFile("drawingdbfiles/test/x.txt", 8, true)
I still get path not found.
On the web server, if i type H:\test\x.txt in the run line, the text document comes up fine.

Bad news, it didn't work, good news, it is a different error!! hehehe
 
I kept on getting that error, path not found until I changed the anonoymous user account in IIS on the webserver to use the administrator account from the file server,...that is the only thing I can think of???
 
Ok, this is easier than it should be.

The IUSR_Machine account is NOT logged on the the Server, so the mapped drives are NOT mapped for the anonymous user!!

so your fso.opentextfile would NEVER work.

Why not use a UNC?

fso_OpenTextFile("\\servername\test\x.txt")

of course this may not work either, most likely it won't

If you change the anonymous user that the website uses to a Doman User that has access to the folder in question, it would.

Another way would be to use WScript
Code:
	set WshNetwork = Server.CreateObject("Wscript.Network")
 	WshNetwork.MapNetworkDrive "Z:", "\\servername\folder", "false", "domain\username", "password"

now you'll be able to use the drive letters in your path because you are actually mapping for real
 
pkailas, it worked! I will just create another domain account to use besides the admin on! Thanks to both of you for all of your help!!!



[ponytails]
 
pkailas, it worked! I will just create another domain account to use besides the admin on! Here is my code:
Code:
dim wshnetwork
					
set WshNetwork = Server.CreateObject("Wscript.Network")
WshNetwork.MapNetworkDrive "Z:", "\\esp10\drawingdbfiles", "false", "our-domain.com\theadminaccount", "thepassword"

FileName = Mid(Filename,InstrRev(FileName,"\")+1)
					
set fso = Server.CreateObject("Scripting.Filesystemobject")
set fle = fso.CreateTextFile(("z:/test/" & FileName), true)
Thanks to both of you for all of your help!!!



[ponytails]
 
which way did you end up doing it? Changing the anonymous user in the web site or using WScript?
 
I mapped the network drive like you suggested using the WScript. I love it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top