ftp from the command line - similar to wget

/ Published in: DOS Batch
Save to your folder(s)

ftp from the command line - Here's an example, similar to a wget, all on one line but broken into several lines here for readability:

Commands are delimited using DOS/Window's &. Optionally, the first command could be a del File.txt.

The echo commands create a temporary file, ftpcmd.txt, with three commands:

1. lcd (a local cd to change the local directory),
2. a get command to perform the file transfer
3. a quit to exit from the ftp prompt

ftp's command line parameters:

1. -A login anonymously
2. -s specifies a command file
3. optional -n and -v suppress printed messages
4. ...and the ftp server's ip address.

Copy this code and paste it in your HTML
  1. echo lcd c:\DestDir > ftpcmd.txt &
  2. echo get File.txt >> ftpcmd.txt &
  3. echo quit >> ftpcmd.txt &
  4. ftp -A -s:ftpcmd.txt -n -v
  6. Rem similar to wget

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.