I need to copy files from Samba share in my application. The paths are in smb://host/filename format. How do I do it in nodejs? fs.createReadStream refuses to open these paths. I need to do this on both Windows and *nix.
I need to copy files from Samba share in my application. The paths are
Share
Assuming a Linux host (since you mentioned “samba” and not “MS SMB”), you’ll first need to mount the remote server with
smbmount. This forum post has an overview of how to do that, then you just read the files as if they were local to your server.Alternatively,
smbgetlets you acquire single files without mounting the remote host, but isn’t efficient for a large number of file requests.Another edit; some example code: