I have combed the internet looking for a solution to this, but everything I see points back to serving static files which doesn't appear to do what I want. I'm trying to have my Express server reach out to a local file share using the following:
res.download(pathToFile, fileName, (err) => {
if (err) throw err;
});
pathToFile
is the absolute path to the file location with the file name appended at the end, but this perpetually says there is, "No such file or directory at," pathToFile
location. I'm at my wits end here and could use some help.
EDIT:
To answer questions, access isn't an issue. I am using a Mac and a Windows machine to access the file share without problems. Path looks like so:
//${ipAddressOfServer}/ParentFolder/ChildFolder/${fileName}