FTPGETFILE Get file from directory structure on FTP site |
Top Previous Next |
This command is not valid with HTTP/HTTPS sites.
This script command checks for (and optionally waits for) the existence of a file defined by the [ file name ] argument within the current directory on an FTP site. If a matching file is detected, the file name is saved in the %sitefile variable. The date and time of the file or directory are also saved in the %sitefiledate, %sitefiledatetime, and %sitefiletime variables. The size of the file, in bytes, is saved in the %sitefilesize variable.
This command is functionally equivalent to the GETSITEFILE script command except for two important differences.
FTPGETFILE has the capability to decend into and out of subdirectories that it finds within a given directory tree on the FTP site (assuming the /incldirs option is specified) while GETSITEFILE does not. (GETSITEFILE returns directory names it finds in the %sitedir script variable instead.)
Secondly, FTPGETFILE does away with the /next option. FTPGETFILE will always return the next file found when called repeatedly on the same site directory structure when there are wildcard character(s) in [ file name ]. In the event that you wish to start over with the first matching file in the folder structure, issue the FTPGETREWIND command and then resume issuing FTPGETFILE.
Otherwise refer to the description of GETSITEFILE for more details on this command. Related Commands: FTPGETREWIND |