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

copy files using http or ftp in asp or asp .net

Status
Not open for further replies.

mmorancbt

IS-IT--Management
Nov 11, 2002
367
US
I need to copy files from another webserver. We can ftp them from a client machine but it requires that we pull the files locally and then republish to another website.

Is there a way to do this on the web server side.

As far as I can tell, the filesystem object can only copy on a local network using UNC paths.

Any ideas?

Thanks,

Matthew Moran (career blog and podcast below)
Career Advice with Attitude for the IT Pro
 
I wonder if you could copy the files using a web service?

WebService on Server1 waits for a request from Server2. When server2 needs the file it asks the webservice and it is sent back. I'm not sure if it would be serializable, but that might work.

Otherwise I think you could use FTP (on either server - get or put). I'm pretty sure that you can't copy files from one server to another using just a web page, seems like a pretty big security thing, but I might be wrong.
 
OK, so let me just clarify this. You have:

Webserver A
Webserver B

and you want to copy a file from webserver A to webserver B by using an ASP.NET page that is running on webserver B?

If the above is correct, then you can use the System.IO class with UNC paths as long as the the user that the application is running under (e.g. ASPNET or any impersonated user) has the relevant permissions.

If the above is incorrect, please clarify what it should be.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
You seem to have it.

Webserver A - the files can be retrieved via http:// or ftp://. I have the logon information.

Webserver B needs to retrieve files from time to time. I will have a list of files to retrieve.

Thanks,
Matt

Matthew Moran (career blog and podcast below)
Career Advice with Attitude for the IT Pro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top