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

FileSystemObject problem

Status
Not open for further replies.

OutInLeftField

Programmer
Apr 30, 2002
37
US
I want to copy a file from a network drive to a local drive (c:\ or d:\).

Problem is when I execute the following,
source = request("source")
destination = request("destination")

fso.copyfile source,destination


I am using an input field with the type "file" to display a browser button. After the user chooses the file/folder to copy for source and destination, he/she clicks on submit button. If the files are in the server itself, the copy works; however, if the file is on the users machine's harddrive, I get the following error:

Microsoft VBScript runtime error '800a004c'

Path not found

/deptinfo/phonlist/CopyFiles.asp, line 14

line fourteen is:

fso.copyfile source,destination

I am guessing that the c:\ drive portion fails because the c:\ is the harddrive on the Web Server not the c drive on my machine.

How can I copy a file from my machine's harddrive to the network and vise versa?

Thanks
 
The user the IIS runs under is not a domain user by default. So it can't access network drives. Two ways around this are set the account the IIS services use to be a domain user, or look on the msdn.microsoft.com for impersonate user, this is code for a dll to allow ASP to impersonate a user you need full credentials username/password but it works.

Hope this help, let me know.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top