Sivasan
asked on
Batch file to download a file from FTP server
Hi There,
I need to create a batch file to download a file in a particular folder from the FTp server to a folder on the local drive
Example this is what I have
my ftp server name ftp.mydomain.com
user name test
password testp
so on the FTP server on a folder called Testfolder, I need to download all the files in this folder to the local C drive
in C:\temp folder
I will appreciate if somebody can give me the line that will go on the batch file. I tried few never worked.
I need to create a batch file to download a file in a particular folder from the FTp server to a folder on the local drive
Example this is what I have
my ftp server name ftp.mydomain.com
user name test
password testp
so on the FTP server on a folder called Testfolder, I need to download all the files in this folder to the local C drive
in C:\temp folder
I will appreciate if somebody can give me the line that will go on the batch file. I tried few never worked.
ASKER
Hi SStory,
Thank you so much, it work, it downloads the file, but when I look at the size of the file it says 0 bytes, so I'm wondering if it completly downloaded the file. Is there a way I can make sure connection is open till file is downloaded completely?
thanks
Thank you so much, it work, it downloads the file, but when I look at the size of the file it says 0 bytes, so I'm wondering if it completly downloaded the file. Is there a way I can make sure connection is open till file is downloaded completely?
thanks
Basic ftp commands can be found by using Google. Here are two examples:
http://www.nsftools.com/tips/MSFTP.htm
http://www.cs.colostate.edu/helpdocs/ftp.html
It sounds like it may be timing out on your before it finishes or there is some other problem. I know of no other way to tell it to 'stay open'. Mine just works when I do that.
I see a trace command that _MIGHT_ help you diagnose it.
http://www.nsftools.com/tips/MSFTP.htm
http://www.cs.colostate.edu/helpdocs/ftp.html
It sounds like it may be timing out on your before it finishes or there is some other problem. I know of no other way to tell it to 'stay open'. Mine just works when I do that.
I see a trace command that _MIGHT_ help you diagnose it.
ASKER
Adding the trace command didn't bring up any trace, not sure if I'm using it right.
thanks
thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks SStory, I will try few ftp solutions. Thanks for all your help
Your batch should look something like this
cd c:\Temp
ftp -n -s:C:\yourscript.src ipOfFTPServer
The script should contain something like:
Open in new window
Obviously you should change some things in the ftp line as needed, etc.