ftp_cmd()

Read(14) Label: ftp server, interact,

Description:

Send FTP commands to interact with the server.

Syntax:

ftp_cmd(client,cmd,args,...)

Note:

FtpCli external library function (See External Library Guide).

 

The function sends FTP commands to interact with the server.

Parameter:

client

FTP client object.

cmd

Commands.

args

Command arguments, which differ by command.

Option:

@f

Force the overwrite of same-name files. Apply to put/get/mput/mget.

@t

Skip same-name files. Apply to mput/mget.

Example:

 

A

 

1

=ftp_open("192.168.75.1":21,"Administrator","admin")

 

2

=ftp_cmd(A1,"ls","/folder1")

List remote directory contents.

3

=ftp_cmd(A1,"mkdir","/folder1/ff1")

Create remote directories.

4

=ftp_cmd(A1,"put","/folder1/ff1/stu.txt","F:/stu.txt")

Upload local file stu.txt to the specified location.

5

=ftp_cmd@f(A1,"mget","/folder1/ff1","F:/tmp","e*.txt")

Download all txt files beginning with e in the specified directories to the local, and force the overwrite of same-name files.

6

>ftp_close(A1)