Send File for Download
Audience:
Low-code EngineersSkill Prerequisites:
Actions
Sends the user to a file of the portal. You pick the file when you set up the action, so it's always the same file. The browser opens the file's URL, for example /Portals/0/Documents/Price-List.pdf, and then downloads or shows it.
It works in Forms, Listings, User Guides and APIs. It ends the action list, so actions after it don't run.
The file must already be uploaded to a folder of the portal.
Typical Use Cases
- Give users a brochure, price list or template after they fill in a form
- Add a "Download instructions" button to a listing
- Return a fixed file, such as a sample CSV, from an API URL
Don't use it to
- Send a file that's chosen or created at run time, for example a generated PDF. Use Redirect to URL with a token that holds the file's URL.
- Force the browser to download a file it can show, like a PDF. Use Redirect to URL with Force Download on.
- Send a file from a protected folder, or check the user's permissions. In APIs, use Download File instead.
- Send text built from tokens as a file. Use Send Plain Text as File Download instead.
Related Actions
| Action Name | Description |
|---|---|
| Redirect to URL | Sends the user to any URL, and can force a download. |
| Redirect to Portal Page | Sends the user to a page of the portal. |
| Send Plain Text as File Download | Sends text built from tokens as a file. |
| Download File | Returns a file's content from an API, with a file name and permission checks. |
| File Response | Returns a portal file by ID from an API, with response caching. |
Input Parameter Reference
The parameters unique to this action are listed below. Review the common parameters for all actions here. The parameters depend on where the action is used.
Forms and Listings
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Portal File | The file to send. Click Change, browse the portal's folders and select one file. The action saves the file's ID, so the file can be renamed or moved later. | No | empty | Yes |
| Open in Popup | Opens the file in a popup window on top of the current page, inside an iframe. Shown when Open in new tab is off. | No | false | No |
| Popup Title | The title of the popup. Shown when Open in Popup is on. | Yes | empty string | No |
| Open in new tab | Opens the file in a new browser tab. Safari opens it in the same tab. Shown when Open in Popup is off. | No | false | No |
APIs and User Guides
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| File | The file to send, picked from a list of the files in the portal's home folder and its subfolders. The action saves the file's path, for example Documents/Price-List.pdf, so the action breaks if the file is renamed or moved. | No | empty | Yes |
Differences by module
| Forms and Listings | APIs | User Guides | |
|---|---|---|---|
| File saved as | File ID | Path | Path |
| Checks | Fails with an error if the file doesn't exist or belongs to another portal | None | None |
| What happens | The browser goes to the file. The popup and new tab options apply. | The API answers with 302 Found and the file URL in the Location header | The browser goes to the file in the same window |
| Popup and new tab options | Yes | No | No |
In a form's On Page Load actions, the server redirects to the file with a 302 before the form is shown, and the popup and new tab options are ignored.
How the download works
The action doesn't send the file's content itself. It sends the user to the file's direct URL under the portal's home folder. The web server then serves the file like any other static file:
- Files the browser can't show, like ZIP or Office files, are downloaded.
- Files the browser can show, like PDFs, images and text, usually open in the browser. There's no option to force a download.
Considerations
- Folder permissions aren't checked. Anyone who runs the action gets the file's direct URL, and can share it. Don't use it for private files.
- Use a standard folder. Because the direct URL is used, files in secure or database folders can't be opened this way. In APIs, use Download File for those.
- In APIs and User Guides, pick a file in a subfolder. A file directly in the portal's home folder gets a URL without the home folder path, which doesn't work.
- The file is fixed. Portal File and File don't support tokens. To send a file chosen at run time, use Redirect to URL with a token, for example the
Store LinkClick Urltoken of Generate PDF. - Put it last. The action ends the action list. Actions after it don't run.
- In APIs, prefer Download File or File Response. They send the file's content, and Download File also checks permissions and can rename the file.
Examples
To understand how to use the below examples, please see Running Examples.
1. Download a price list after a form is submitted
This action, in a form button's actions, sends the user to the file with ID 1024, for example Documents/Price-List.pdf. The file opens in a new tab, so the form stays open.
{
"Title": "Send File for Download",
"ActionType": "RedirectToFile",
"Description": "Send the price list",
"Parameters": {
"PortalFile": [
{
"Text": "Price-List.pdf",
"Value": "1024",
"Filter": "12"
}
],
"OpenInPopup": false,
"PopupTitle": "",
"OpenInNewTab": true
}
}
2. Return a sample file from an API
This action, in an API, redirects the caller to Templates/Import-Sample.csv in the portal's home folder.
{
"Title": "Send File for Download",
"ActionType": "RedirectToFile",
"Description": "Redirect to the import sample",
"Parameters": {
"File": {
"Expression": "",
"Value": "Templates/Import-Sample.csv",
"IsExpression": false,
"Parameters": {}
}
}
}
Revised 09/27/2026