I am trying to map a network drive using directory tree package in nodejs. It works perfectly when the files is in one of my local drives, but i have trouble acessing my network drive. I want to be able to form a json file to represent the directory tree of that drive and display this in my front end. Is this something i can do for a network drive? Here is my code
router.get('/files', function (req, res) {
var tree = dirTree('X:/Images');
res.send(tree);
});
My network drive is mapped to X
Sure, this is something you can do provided you have network access to that drive with the user running the application. Theres no implementation difference in accessing a mapped network drive and a folder on your local drive, you just need the correct permissions.
If you just ran your code you would see pretty quickly if it works.