node.js - Listing files from a remote directory with node -
i have remote directory on 'xyz.com/myimages/'. directory has many files in it.
i use node.js app retrieve list of file names url (xyz.com/myimages/). have verified apache configured permit directory indexing path.
how can retrieve file names form url using node.js?
if have ssh access can this:
var exec = require('child_process').exec; exec("ssh login@xyz.com 'ls /path/to/myimages'", function (error, stdout, stderr) { console.log('remote files: ' + stdout); });
Comments
Post a Comment