I have a project where users can upload an image that gets stored to both a SQL database, and to a drive on the gateway. Later, we use a mounted folder to serve the images that are stored on the drive. Then we display those images in a web page created by a WebDev, python resource. For reasons I won' t go into, we don't want to pull these images from the database for display.
All of this works fine if the drive is local to the gateway. We prefer not to store the images directly on the gateway's drive though as we don't want to use space on the VM for this reason. We would prefer to map a drive on the gateway to a NAS and store the files on the mapped drive. This is where the problem arises.
When we run this script on the upload component (in Perspective):
def runAction(self, event):
fileName = event.file.name
#path = "C://ExpenseReceipts/" + fileName
path = "X://expenseReceipts/" + fileName
system.file.writeFile(path, event.file.getBytes())
The commented line to the C:\ drive above works like we expect. The uncommented line to the X:\ drive does not. The X:\ drive is the mapped drive.
Both of these drives have been created as WebDev mounted folders.
The error returned in the log is:
Error running action 'component.onFileReceived' on JMS/Expenses/test@C/root/FileUpload: Traceback (most recent call last): File "function:runAction", line 5, in runAction IOError: Unable to create path to file 'X:\expenseReceipts\myFile.pdf'