javascript - spaces in url ftp client in node.js -
i use ftp node.js , i'm able read files , folders folders in urls there no spaces.
this works:
var ftp = require('ftp'); var path = "app/laundrymachine"; var client = new ftp(); //connect properties var config = { host: '***.net', port: 21, user: '***', password: '***' }; client.on('ready', function () { client.list(path, function (err, list) { if (err) throw err; (var in list) { console.log(list[i].name); } client.end(); }); }); client.connect(config);
but, if var path have space it's not work.
var path = "app/laundry machine";
i try put %20 or +, still not.
you can use listsafe method instead of list.
"this useful servers not handle characters spaces , quotes in directory names list command."
Comments
Post a Comment