How to download files hosted in the server

Hello everyone,


I am trying to provide the end-user with the possibility to download some files hosted in the server where an Outsystems reactive app connected to an external DB is running.

The files are added to the server by an RPA robot, in the beginning, the idea was to convert the files to binary data and insert them into the DB but the robot isn’t able to convert the files and insert them.

I’ve tried some forge components:

  • FileSystem by João Portela, this one detects the directory and the file but when I try the File_ReadBinary server action it returns BinaryData(0 bytes)
  • Network FileSystem by Matthias Preuter, this one just doesn't seem to work


Is there a way to get the binary data of a file hosted in the server, if possible could someone explain how to do it?


Thank you for your time

 João Pires

mvp_badge
MVP

Hi João,

As I understand it, Network FileSystem is deprecated, and its features are incorporated in the FileSystem extension. Note that you need to make sure that you supply the right credentials to be able to read from a network share, as the default OutSystems IIS user probably doesn't have the right priviliges. The alternative could be to set the Run As User of the consuming Module in Service Center.

Hi Kilian, 


Thank you for the quick answer.

I've tried to search how to Run As User of the consuming Module in Service Center, but I couldn't find anything, could you elaborate on how to do it or maybe direct me to an existing Outsystems tutorial?





mvp_badge
MVP

Hi João,

The Run As User can be set on the "Operation" tab of a Module in Service Center:

Hi Kilian,

Thank you once again.


I think I'm in the right place, but I can't find the "Run As User" options.

I'm annexing a print to show what I get under the "Operation" tab in Service Center.

Module.png

mvp_badge
MVP

Indeed, that's where I would expect it. This might be a matter of priviliges? I'm not sure.

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