如何使用node-ftp

时间:2018-06-06 07:11:31

标签: javascript html node.js ftp node-ftp

我的nodejs网络应用程序需要通过ftp发送xml,当我按下提交按钮时应用程序运行正常,但是当我和我的同事试图同时按下该按钮时,应用程序返回错误:

Error: Unable to parse PASV server response
at Object.reentry [as cb] (C:\Users\astrina\Documents\progetti\kantarnuovo\node_modules\ftp\lib\connection.js:857:19)
at Parser.<anonymous> (C:\Users\astrina\Documents\progetti\kantarnuovo\node_modules\ftp\lib\connection.js:117:20)
at emitTwo (events.js:126:13)
at Parser.emit (events.js:214:7)
at Parser._write (C:\Users\astrina\Documents\progetti\kantarnuovo\node_modules\ftp\lib\parser.js:59:10)
at doWrite (_stream_writable.js:397:12)
at writeOrBuffer (_stream_writable.js:383:5)
at Parser.Writable.write (_stream_writable.js:290:11)
at Socket.ondata (C:\Users\astrina\Documents\progetti\kantarnuovo\node_modules\ftp\lib\connection.js:273:20)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:607:20)

这是xml发送:

c.put("example/Broadcast_"+blockid+".xml", "/EC/Broadcast/Broadcast_"+blockid+".xml", (err)=>{
             if (err) alert(err)
           });
           c.end()

这是ftp声明:

var c = new Client();
  c.connect({ 
  host: "ftpnew.kantarmedia.fr",
  port: 21, // defaults to 21
  user: "km_italie", // defaults to "anonymous"
  password: "km14IT05", // defaults to "@anonymous"
  keepalive: 10000
  })

0 个答案:

没有答案