ftp_mget()

Description:

Download multiple files from a FTP server.

Syntax:

ftp_mget(client,serverFolder,localFolder,multiServerFiles)

Note:

This is an external library function. 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. The parameter can be absent, but its position must be kept by retaining the comma. 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. The parameter can be absent, but its position must be kept by retaining the comma. 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.

Options:

@f

Overwrite a namesake file

@t

Skip a namesake file

Parameters:

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_client("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 functions:

ftp_mput()

ftp_put()