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

FSO CopyFile -remote to local 1

Status
Not open for further replies.

ikswoktur

Programmer
Oct 11, 2002
29
0
0
US
I have seen a couple other posts on this, but none have worked... i am trying to copy files from a remote server to a local drive. i am getting a permission denied error even though i have full permissions on the remote box. Any tips or pointers would be helpful. Thanks

Code:
<%
dim fs
set fs=Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
fs.CopyFile &quot;r:\boundary.e00&quot;,&quot;c:\temp\&quot;
set fs=nothing
%>
 
If this is running on a webserver: You say that YOU have access, but does your Anonymous IIS Web-User have access to the files? Check the IIS settings for anonymous user. YOUR permissions won't matter if the ASP is being run under different credentials.

...or, are you running this on a local machine? Is the &quot;r&quot; drive mapped properly? Why not just use a network address (\\servername\share\file.ooo)? That'd be more accurate and should run properly from anywhere on your network.

If you're running this on only your local machine, why not use a .BAT file?
 
On a side note... is it possible to pass a different set of credentials to the FSO object rather than using the IIS credentials? Kind of like how you can pass a username and password in a db connect string?
 
The asp page is being called from a personal web server on my machine. Does this pass the username of my logged-on profile? i would be interested in knowing a way to pass a user name and password in the code like AdmanOK questioned... that way i can make this a broader application. the anonymous security settings on the remote server can't be changed. thanks
 
Check your Personal Web Server settings... it shouldn't be using YOUR credentials, it should be using some anonymous credentials (on IIS, it's usually something like &quot;IUSR_SERVERNAME&quot;). You CAN change the anonymous settings on your Personal Web Server.

Change them to something that will provide you access to the files you seek.

The credentials used by FSO should be the anonymous settings of the web-server it's executing from.

I do not think that the FileSystemObject will allow you to manipulate it's credentials. You can, I believe, set different &quot;anonymous&quot; credentials to be used when executing pages within a particular folder on your web-site. (Note: I could be wrong about that)

Good luck with your project.
 
Thanks, you've pointed me in the right direction on this, pretty straight-forward from here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top