Jump to content

fso copyfile permission denied


beyonder422
 Share

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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...