How to SFTP/FTP a file from an Entity or SQL statement?

How to SFTP/FTP a file from an Entity or SQL statement?


Dear gurus,

I am planning to get OutSystems to talk to our application (which sit behind firewall). There are two challenges for me in Outsystems.

  1. How to write a physical file (CSV/XLSX) from result return from SQL or Entity?
  2. and from the file generated in outsystem, how can i FTP/SFTP it to a remote location?

Thank you


Hey Wellies,

I hope that the data in sql entity will be binary data , there are extensions which helps you to write this binary data to a file in server.

Also there are component to connect \read-write file from  FTP\SFTP . See the below links..



FTP Web Request



Hi Weilies,

In case you only need simple export to Excel, you can use the built-in Record List To Excel tool, which you can find in Service Studio on the toolbar on the left. It has a binary as output, which you can write to a file using the FileSystem extension (which is available as a Forge component, see Pramod's link). Note however that when using that, you need to make sure the eSpace has a Run As user that can write to the destination directory, or have a destination directory that is read/write for all.

If you do not need to first write the file to a local directory, you can directly use SFTP (see Pramod's link) to upload the binary to the FTP-site (assuming it supports SFTP), or use plain FTP.