Syntax:

GETFILE2(remote_file_name, save_as)

  • remote_file_name: The remote file to be downloaded. A path can be optionally included in this parameter.
  • save_as: The downloaded file will be saved using this name.

Remarks:

  • The saved_as parameter must contain no path, only a file name is allowed.
  • The file will be saved under the current local directory. Use LOCALCHDIR to change it before calling GETFILE2.

See also:

GETFILE
SYNC

Command history:

This command was added in ScriptFTP version 3.3.

Example:

OPENHOST("127.0.0.1","carl","123456")
 
# Download 1234.txt and save in under the name qwerty.txt
GETFILE2("1234.txt","qwerty.txt")
 
# Download test.txt which is under the remote subdirectory
# myremotesubdir and save in under the name qwerty.txt
GETFILE2("/myremotesubdir/test.txt","qwerty.txt")
 
CLOSEHOST