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

Batch file issue with ftp web site 1

Status
Not open for further replies.

dmaytum

Programmer
Mar 4, 2003
23
US
I'm trying to use a batch file to copy a file from a web site to my local machine. The web site is ftp: // username:password @domain.com. Do I need to reference an ftp file in the batch. I'm not really sure how to go out and grab it. The batch I've been trying is:

echo open ftp: //username:password @domain.com >ftp1
echo get my file.zip>>ftp1
echo quit>>ftp1
ftp -s:ftp1

but I can't connect with the FTP command.
If I enter the URL into my browser, it takes me to the site and I can click on the file and download it. Anyone have any ideas on how I can download it automatically with a batch file?

Thanks
 
Hi

I have done this but slightly differently.

My ftp batch file contains: ftp -s:ftpcmds.txt domain.com

ftpcmds.txt contains:
login
password
get filename.txt
quit

So the connection gets done by the initial ftp command by putting the domain name there, then the responses to the login and password prompts and the command(s) to be executed are in the script file.

That may not be the only way, but it works for me.

Jock
 
Is there a proxy/firewall between your computer and the ftp site?
 
There is a firewall but I assumed it was allowing access since I can enter the URL into my browser.
 
What firewall do you have? (corporate or personal) any access control?

This may be important, for example with MS-Proxy, FTP read and FTP (read/write or in DOS mode) are two completely different things.
 
It's a corporate firewall. I don't know much about it. I cannot change any control parameters on the firewall. Thanks for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top