I am trying to upload a file on an ftp server using node.js as below -
I use the library https://github.com/sergi/jsftp
var fs = require('fs'); var Ftp = new JSFtp({ host: "ftp.some.net", port: 21, // defaults to 21 user: "username", // defaults to "anonymous" pass: "pass", debugMode: true // defaults to "@anonymous" });
File Download -
exports.UploadToFtP = function (req, res) { Ftp.put('public/Test.html', '/Test/index.html', function (err) { if (!err) res.send(200); else res.send(err); }); };
I tried to upload the file using this method above and it answers me with 200 OK . But there are no files on the server. Should this do something with server connection time? Why does this not write the file to the server?
source share