Marco wrote:
> Hi. I need to send every day some txt files into an ftp server.
>
> I heard that I could use FTP command of Windows with a script. Anyone know
> were I can find an example?
>
> regards,
> Marco
This Google groups search has 23,000 archived posts on the question.
> Hi. I need to send every day some txt file into a ftp server.
>
> I eard that i could use FTP command of winfows with a script. anyone knows
> were can I find an example?
>
> regards,
> Marco
I do this routinely.
There are two ways to do it, which differ on how to store/enter the
password for the server. Since I like to type in the password each time
I run my script, here's how I do it.
My command script (.BAT file) contains the line
ftp <upload.ftp
Where file upload.ftp contains the lines
open myserver.com
myuser
cd /pub/files
ascii
put today.txt today.txt
binary
put files.zip files.zip
put picture.jpg picture.jpg
quit
Note: After FTP reads my username "myuser" as above it will prompt me
to enter the password.
The other way to do it includes the password in the command file.
In this case, the command script (.BAT file) contains the line
ftp -s:upload.ftp
open myserver.com
myuser
mypassword
cd /pub/files
ascii
put today.txt today.txt
binary
put files.zip files.zip
put picture.jpg picture.jpg
quit
Note: The effect is the same except this time both my username "myuser"
and my password "mypassword" are read from file upload.ftp.
For more information type "ftp -?" on your command line.
I hope this helps.