I have a cross-platform (macOS-Windows) "slideshow" type app built in Electron
which works fine with files and media assets from a local drive but fails with UNC paths and "mapped network drives". Compounding the issue is, as a contractor, I don't have access to that sort of networked computing environment to debug this issue.
A recent comment from the IT person at a customer's office:
we noticed that when trying to open project files using a UNC path (i.e. \\servername\share1\presenter ) it doesn’t show images, but when we mapped a drive (i.e. z:\ drive) and pointed to the same location the images loaded as expected. Is this a known issue?
I've searched around but haven't seen any clear solutions for handling loading files and reading/writing to JSON files stored on a networked drive. Worse, I don't really understand the tech issues involved. Can anyone help?
Details: Through Electron dialogs, a user is able to create or open a "project" and select media assets to be copied into the project. A project consists of a directory containing aJSON
file and these media assets. The JSON
file references the assets using paths relative to the project folder (e.g. "filePath": "assets/images/500x500.png"
). To load an asset I use upath
and join the project path with the relative asset path:
upath.toUnix(upath.join(projectDirectory, d.eventMedia.imageList[i].filePath))
Which would result in something like:
c:/Documents/mySuperProject/assets/images/500x500.png
This has worked pretty well across both macOS and Windows. I don't understand what the fail point is with UNC paths.