Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 81 characters in body
Source Link
user3163213
  • 691
  • 4
  • 15
  • 40

I am trying to upload a file on ftp server using node.js as below-

I am using 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" }); 

Uploading file-

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 uploading file with this method above and it responds me back with 200 OK . But I get no file on server. Is this has to do something with connection time out of server ? Why this is not writing file on server?

I am trying to upload a file on ftp server using node.js as below-

I am using 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" }); 

Uploading file-

 Ftp.put('public/Test.html', '/Test/index.html', function (err) { if (!err) res.send(200); else res.send(err); }); 

I tried uploading file with this method above and it responds me back with 200 OK . But I get no file on server. Is this has to do something with connection time out of server ? Why this is not writing file on server?

I am trying to upload a file on ftp server using node.js as below-

I am using 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" }); 

Uploading file-

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 uploading file with this method above and it responds me back with 200 OK . But I get no file on server. Is this has to do something with connection time out of server ? Why this is not writing file on server?

Source Link
user3163213
  • 691
  • 4
  • 15
  • 40

uploading file to ftp server in node.js

I am trying to upload a file on ftp server using node.js as below-

I am using 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" }); 

Uploading file-

 Ftp.put('public/Test.html', '/Test/index.html', function (err) { if (!err) res.send(200); else res.send(err); }); 

I tried uploading file with this method above and it responds me back with 200 OK . But I get no file on server. Is this has to do something with connection time out of server ? Why this is not writing file on server?