API 参考
正在准备搜索索引…

基于 basic-ftp 的 FTP 客户端,操作通过队列按调用顺序执行。

源码与继承
成员目录21

构造函数

属性

方法

构造函数

属性

DirectoryResponse: typeof FtpDirectoryResponse = FtpDirectoryResponse

工作目录响应类型。

源码与继承
ListingResponse: typeof FtpListingResponse = FtpListingResponse

目录列表响应类型。

源码与继承
Response: typeof FtpResponse = FtpResponse

基本 FTP 响应类型。

源码与继承
TransferMode: typeof TransferMode = TransferMode

文件传输模式枚举。

源码与继承

方法

  • 中止所有未完成操作并释放两条连接。

    返回值

    void
    源码与继承
  • 下载远端文件到本地目录 localPath,保留源文件名,默认二进制传输。

    参数

    remoteFile
    string
    localPath
    string
    mode
    TransferMode = TransferMode.Binary

    返回值

    Promise<FtpResponse>
    源码与继承
  • 异步登录,省略参数时使用匿名账号。

    参数

    name
    string = 'anonymous'
    password
    string = 'user@sfml-dev.org'

    返回值

    Promise<FtpResponse>
    源码与继承
  • 将远端文件或目录从 path 重命名为 newPath。

    参数

    path
    string
    newPath
    string

    返回值

    Promise<FtpResponse>
    源码与继承
  • 按队列顺序发送原始 FTP 命令及参数,参数不得含换行或空字节。

    参数

    command
    string
    parameter
    string = ''

    返回值

    Promise<FtpResponse>
    源码与继承
  • 上传本地文件到远端目录,保留文件名;append 为 true 时追加,默认覆盖。

    参数

    localFile
    string
    remotePath
    string
    mode
    TransferMode = TransferMode.Binary
    append
    boolean = false

    返回值

    Promise<FtpResponse>
    源码与继承

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0