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

A humane way to FTP from ASP?

Status
Not open for further replies.

aplusc

Programmer
Feb 17, 2002
44
US
One way or another I need to FTP something from my ASP script. Right now I create the file (which I will FTP), then create a batch file (containing FTP commands), then run the FTP.exe (that comes with MSDOS!) through WSH. And I pass the name of the batch file i.e. "FTP -s: batch.bat" Where it goes after that, nobody knows ...

But isn't this some kind of a Rube Goldberg contraption? Is there no easier way to FTP a file?
 
This is about the best way to do it unless you get really fancy, and have some kind of FTP client service your ASP pages could "dispatch" requests to.

Anything you'd do directly from your ASP page would hang the thread and make the user wait until it completed - both bad things.

I guess I have no idea where you're trying to FTP these files to, but if it is just within your own server farm you'd be better off simply writing to a file share someplace, or perhaps run a scheduled script to copy files from the local drive to the share periodically.

If you are sending files "outside" and especially if sending to several "outsides" the scheduled script approach may not be viable for you, even if it did FTPs instead of copying to a share.

The important thing is that even using the WinInet Control is not advised. This is meant as a client component. If you use it on the server side it will (as I said) tie up an IIS thread and make the user wait until it completes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top