Javascript 如何使用节点FTP处理同步FTP上载
我的nodejs web应用程序需要通过ftp发送xml,当我按下提交按钮时,应用程序工作正常,但当我和同事尝试同时按下按钮时,应用程序返回错误:Javascript 如何使用节点FTP处理同步FTP上载,javascript,html,node.js,ftp,node-ftp,Javascript,Html,Node.js,Ftp,Node Ftp,我的nodejs web应用程序需要通过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.<
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)
这是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
})
如何处理请求?当app.post('form')…被调用时,会生成一个xml,然后通过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
})