@[TOC]
模块功能:FTP客户端
FTP客户端命令
|名称|传入值类型|释义|
|-|-|-|
|command|string|命令,例如"PWD","HELP","SYST"|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
连接到PASV接口
|名称|传入值类型|释义|
|-|-|-|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
FTP客户端登录
|名称|传入值类型|释义|
|-|-|-|
|ftp_mode|string|FTP模式"PASV"or"PORT",默认PASV:被动模式,PORT:主动模式(暂时仅支持被动模式)|
|host|string|ip地址|
|port|string|端口,默认21|
|username|string|用户名|
|password|string|密码|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
|ssl|bool|可选参数,默认为nil,ssl,是否为ssl连接,true表示是,其余表示否|
|cert|table|可选参数,默认为nil,cert,ssl连接需要的证书配置,只有ssl参数为true时,才参数才有意义,cert格式如下:
{
caCert = "ca.crt", --CA证书文件(Base64编码 X.509格式),如果存在此参数,则表示客户端会对服务器的证书进行校验;不存在则不校验
clientCert = "client.crt", --客户端证书文件(Base64编码 X.509格式),服务器对客户端的证书进行校验时会用到此参数
clientKey = "client.key", --客户端私钥文件(Base64编码 X.509格式)
clientPassword = "123456", --客户端证书文件密码[可选]
}|
string,string,返回 response_code, response_message
无
FTP客户端文件上传
|名称|传入值类型|释义|
|-|-|-|
|remote_file|string|远程文件名|
|local_file|string|本地文件名|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
FTP客户端文件下载
|名称|传入值类型|释义|
|-|-|-|
|remote_file|string|远程文件名|
|local_file|string|本地文件名|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
设置FTP传输类型 A:ascii I:Binary
|名称|传入值类型|释义|
|-|-|-|
|mode A:ascii|string|I:Binary|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
显示当前工作目录
|名称|传入值类型|释义|
|-|-|-|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
更改工作目录
|名称|传入值类型|释义|
|-|-|-|
|path|string|工作目录|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
回到上级目录
|名称|传入值类型|释义|
|-|-|-|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
创建目录
|名称|传入值类型|释义|
|-|-|-|
|path|string|目录|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
列出目录列表或文件信息
|名称|传入值类型|释义|
|-|-|-|
|file_irectory|string|目录或文件|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
删除目录
|名称|传入值类型|释义|
|-|-|-|
|file_irectory|string|路径目录|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无
删除文件
|名称|传入值类型|释义|
|-|-|-|
|file_irectory|string|路径文件(相对/绝对)|
|timeout|number|可选参数,默认为0 接收超时时间,单位毫秒|
string,string,返回 response_code, response_message
无