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.

from npmjs.org/package/ftp

"this useful servers not handle characters spaces , quotes in directory names list command."


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -