The path looks like this
\\10.1.10.11\Results\\filename.rtf
From my machine, i can access it just fine by pasting it to Run
box, enter username and password.
I've tried smb2
(smb2) but the sample code just hangs and after awhile, I get Error: read ECONNRESET
.
I need to make this works on both linux and windows.
I figure I might as well just mount it and access it like local file.
for Linux server, I used smbmount
.
Did you escape the backslashes?
var path = "\\\\10.1.10.11\\Results\\filename.rtf";
console.log(path);
Above works, but here's a better looking way (that accomplishes the same path without having to double up those backslashes):
let path = String.raw`\\10.1.10.11\Results\filename.rtf`;
console.log(path);
Warning: With this technique, you still have to double up the backslash if the string ends with a backslash.
Doing this, I just had success attaching a file (located on a network share) to an email via node.js (and the nodemailer package). Perhaps this would apply in what you're doing too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With