How is your experience with the OutSystems Community?
9
Views
1
Comments
Solved
[Shared Folder] Error "Could not open file path (STATUS_OBJECT_NAME_INVALID"
shared-folder
Service icon
Forge asset by Leonardo Fernandes
Application Type
Service

Hello,

Since the Outsystems server is on the cloud I have to use this extension to copy a local file to another server (on premises). I'm trying to copy a pdf file that's stored in the database as a binary data field.

Steps I took to copy:
1- I use the "File_WriteBinary" method in the FileSystem extension to transform the binary data in a physical file in the "c:\temp" directory of the Outsystems frontend. I verified that the file was indeed created using another method from the same extension;

2- I use the "CopyFile" method from this extension but I get the error "Could not open file path (STATUS_OBJECT_NAME_INVALID)".

The conection between the Outsystems frontend and the destination server is working because I can use 2 methods from this extension with success (ListFiles and ListShares). The copy is the only one that returns an error.
This is the way I'm calling the copy method:

The file "TesteGG.txt" is in the c:\temp directory in the frontend.

The share name is "boletins" the "CopyToPath" is empty because the share already directs to the correct folder.
Am I writting the parameters wrong in some way ?

2018-11-09 09-14-06
Gonçalo Almeida
Solution

I'm going to give the solution to my own post, so others don't make the same mistake.
To copy a file from the Outsystems frontend to an on premises server you can't use the "CopyFile" method. You must use the "WriteFile" method, indicating the binary data origin as input and the destination share and file path.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.