Skip to content

Download File – handing a stored file to the user

The command "Download File" sends a stored file to the browser of the user as a download. This page is for administrators who build buttons such as "Download contract".


1. At a glance

Purpose Let the user download a file from a file storage
Typical use A button that downloads the newest document of a record
Where in the editor Toolbar menu "Files" → "Download File"
Needs a user interface Yes
Needs a current record No
Related Get Files, Get File Data

2. Settings

The settings are on the tab "Settings". "Display Name", "Description" and "Execution Condition" are on the tab "General" (see Actions).

Setting Meaning Default / Required
"File Provider" The kind of storage: "Azure Blob Storage" or "S3 Storage" Required
"Credentials" The credentials of the storage, of the kind that matches the file provider Required
"File Id" Expression for the ID of the file – for example the Id of an entry of the list that Get Files writes Required

3. Behaviour

  1. Without a user interface – for example in a scheduled action, a business rule running in the background or a call through the REST API – the command is skipped.
  2. Without "File Provider" or "Credentials", or with an empty "File Id", the command is skipped as well.
  3. Otherwise the browser of the user receives the file. The action waits until the browser has taken it over and then continues.

What the browser does with the file – save it, ask where to save it, or open it – depends on the browser and its settings.


4. Examples

"Download latest invoice" button.

  1. Get Files with the identifier invoice- followed by the record ID writes the list into the variable Invoices.
  2. "Download File" with "File Id" = a Modify Value expression on Invoices with the rules JArrayLastElement and JObjectJsonPathValue (path Id).

Put an "Execution Condition" on the second command that checks whether the list has elements (rule JArrayHasElements), so that nothing happens when there is no invoice yet.


5. Limitations

  • Works only where a user interface is attached.
  • Only files from a file storage can be downloaded. Content that the action has only in a variable must be stored with Add File first.