Jump to content

fso copyfile permission denied

Recommended Posts

I am hosting an asp app "within a company network" that I want to allow people to upload files to from their machines to the web server.I have opened every possible door I can think of. everyone, full control on entire inetpub directory, to include directory (vMapLocal) I am trying to copy to (within inetpub), shared said folder (vMapLocal), everyone full control on share(vMapLocal). IIS "allow anonymous access", "integrated windows authentication" on entire inetpub directory.I am impersonating a certain domainuser by mapping to a drive with certain credentials, and copying to the server using that mapped drive. I also made that domainuser an admin on host server.None of the users i am using are locked out-----------------------------------vFile = request.Form("txtFile") 'input from web page in this form- "C:\temp\file.txt"vCLIENT_ADDR= Request.ServerVariables("REMOTE_ADDR") 'client ip vMapLocal = "\\servername\sharedfoldername" 'host shared folder everyone/fullvNID = "domainname\domainuser"vPwd = "password" vDrive = "Z:" set wsn=Server.CreateObject("WScript.Network")wsn.MapNetworkDrive vDrive, vMapLocal, false, vNID, vPwd vFile = replace(vFile,":","$")vFile = "\\" & vCLIENT_ADDR & "\" & vFilevFile_Destination = vMapLocal & "\" Set fso = Server.CreateObject("Scripting.FileSystemObject") 'Copy File To App Location *********************fso.CopyFile vFile, vFile_Destinationwsn.RemoveNetworkDrive vDrive,false,false set wsn = nothing set fso=nothing -----------------------------------I can create the map.I've deleted and copied files from client boxes to the host intermitantly, but no consistancy at all. And here of late, it has shut down completely.Everytime as of late, "permission denied"

Link to post
Share on other sites

My knowledge of ASP is confined to VB/VBS unfortunately, so i'm a bit limited in helping you here, but while running through the script in my head:vFile_Destination = vMapLocal & "\" and then:fso.CopyFile vFile, vFile_DestinationWould you not want it to CopyFile to the mapped network drive, rather than the original source? (so Z:\ rather than \\servername\sharedfoldername)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...