Giter Site home page Giter Site logo

ftp-upload's People

Contributors

jerry2359 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

midark nxg916

ftp-upload's Issues

和你的例子一样,为什么不行呢

和你的例子一样,为什么不行呢

const FtpUpload = require('ftp-upload')
const ftpUpload = new FtpUpload({
    // 指定一个远程域名,生成测试连接时会用到
    remoteDomain: '10.22.24.195',
    // 指定一个远程目录
    // 注:必须以 / 开头
    // 支持两种模式:
    // 1、普通模式,上传的文件将直接存放到该路径下。
    //    如:'/test/first'
    // 2、字符串匹配模式,该模式会将[date]和[random]替换成当前日期和随机数。
    //    当字符串中有[random]时,会询问是否手动输入一个值替换随机数
    //    如:'/test/[date]' 或 '/test/[date]/[random]'
    remotePath: '/image_site/event/2019/07/activity/tvScreenXian/config/11111',
    // autoRemotePath: true, // 跳过询问远程目录,默认false
    // autoOverwirte: true, // 跳过询问覆盖已有目录,默认false
    // 支持同时上传多个文件,建议2~3个
    threads: 3,
    // 指定一个本地目录
    // 这里必须是一个绝对路径
    localPath: path.resolve(__dirname, 'activity/tvScreenXian/config/11111'),
    // ftp登录的账号密码等信息
    host:"10.22.24.195",
    user:"freya",
    password:"",
    port:"21"
    // 上传完成的回调
    /*success: function (res) {
      console.log(res)
    }*/
})

// 初始化准备工作
ftpUpload.init().on('ready', function (res) {
    // 处理一些逻辑...
    // ...
    setTimeout(() => {
        // 开始上传文件
        // this.start(res.remoteDestPath)
    }, 3000)
})

// 文件上传成功
ftpUpload.on('success', function (res) {
    console.log(res)
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.