ftp - ftp Client#

Adapted Air780E/Air700E Air780EP Air601 Air101/Air103 Air105 ESP32C3 ESP32S3

Note

This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!

Tip

This library has its own demo,click this link to view ftp demo examples

ftp.login(adapter,ip_addr,port,username,password)#

FTP Client

Parameters

Incoming Value Type

Explanation

int

The adapter serial number can only be socket.ETH0, socket.STA, socket.AP. If it is not filled in, the platform’s own method will be selected, and then the last registered adapter will be selected.

string

ip_addr Address

string

port port, default 21

string

username User Name

string

password Password

bool/table

whether it is an ssl encrypted connection, default is no encryption, true is the simplest encryption without certificate, table is encrypted with certificate
server_cert server ca certificate data
client_cert client ca certificate data
client_key client private key encrypted data
client_password client private key password data

Return Value

return value type

explanation

bool/string

Return true on success Return true on failure string

Examples

ftp_login = ftp.login(nil,"xxx")

ftp.command(cmd)#

FTP Command

Parameters

Incoming Value Type

Explanation

string

cmd Commands currently supported:NOOP SYST TYPE PWD MKD CWD CDUP RMD DELE LIST

Return Value

return value type

explanation

string

Return true on success Return true on failure string

Examples

    print(ftp.command("NOOP").wait())
    print(ftp.command("SYST").wait())
    print(ftp.command("TYPE I").wait())
    print(ftp.command("PWD").wait())
    print(ftp.command("MKD QWER").wait())
    print(ftp.command("CWD /QWER").wait())
    print(ftp.command("CDUP").wait())
    print(ftp.command("RMD QWER").wait())
    print(ftp.command("DELE /1/12222.txt").wait())

ftp.pull(local_name,remote_name)#

FTP File Download

Parameters

Incoming Value Type

Explanation

string

local_name Local File

string

remote_name Server Files

Return Value

return value type

explanation

bool/string

Return true on success Return true on failure string

Examples

ftp.pull("/1222.txt","/1222.txt").wait()

ftp.push(local_name,remote_name)#

FTP File Upload

Parameters

Incoming Value Type

Explanation

string

local_name Local File

string

remote_name Server Files

Return Value

return value type

explanation

bool/string

Return true on success Return true on failure string

Examples

ftp.push("/1222.txt","/1222.txt").wait()

ftp.close()#

FTP Client Shutdown

Parameters

None

Return Value

return value type

explanation

bool/string

Return true on success Return true on failure string

Examples

ftp.close().wait()