Description:
Download multiple files from a FTP server.
Syntax:
ftp_mget(client,serverFolder,localFolder,multiServerFiles)
Note:
This is an external library function (See External Library Guide). When parameter serverFolder is a relative path, it is relative to the current working directory; when it is preceded by a slash sign (/), it is an absolute path. When the parameter is absent, the comma must be retained. If the parameter is an empty string or is absent, the folder path is relative to the current working directory.
When parameter localFolder is a relative path, it is relative to the path configured in esProc Options -> Main directory. When the parameter is absent, the comma must be retained. If the parameter is an empty string or is absent, the folder path is relative to the path configured in esProc Options -> Main directory.
For a wildcard character, the question mark (?) signifies a single character, an asterisk (*) signifies any character, and double asterisk (**) signifies any character plus a directory.
Option:
@f |
Overwrite a namesake file |
@t |
Skip a namesake file |
Parameter:
client |
An FTP client object |
serverFolder |
A server folder |
localFolder |
A local folder |
multiServerFiles |
Wildcard-specified server files; can be duplicated |
Example:
|
A |
|
1 |
=ftp_open("192.168.75.1":21,"Administrator","admin") |
|
2 |
=ftp_cd(A1,"/ WorkingDirectory ") |
|
3 |
=ftp_mget@f(A1,"folder1","G:/download","*.doc") |
Download files suffixed by doc under folder1 directory to G:/download directory while overwriting namesake files. |
4 |
=ftp_mget@f(A1,"folder1","G:/download","*.xls","*.xlsx") |
Download files suffixed by xls and xlsx under folder1 directory to G:/download directory. |
5 |
=ftp_mget@f(A1,"folder1","G:/download","**") |
Download all files under folder1 directory to G:/download directory. |
6 |
=ftp_mget@t(A1,"folder2","G:/download","*.docx") |
Download files suffixed by docx under folder2 directory to G:/download directory while skipping namesake files. |
7 |
>ftp_close(A1) |
|
Related function: