Skip to main content
Version: 1.28 (Current)

Send File for Download

Audience: Low-code Engineers

Skill 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.
Action NameDescription
Redirect to URLSends the user to any URL, and can force a download.
Redirect to Portal PageSends the user to a page of the portal.
Send Plain Text as File DownloadSends text built from tokens as a file.
Download FileReturns a file's content from an API, with a file name and permission checks.
File ResponseReturns 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​

ParameterDescriptionSupports TokensDefaultRequired
Portal FileThe 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.NoemptyYes
Open in PopupOpens the file in a popup window on top of the current page, inside an iframe. Shown when Open in new tab is off.NofalseNo
Popup TitleThe title of the popup. Shown when Open in Popup is on.Yesempty stringNo
Open in new tabOpens the file in a new browser tab. Safari opens it in the same tab. Shown when Open in Popup is off.NofalseNo

APIs and User Guides​

ParameterDescriptionSupports TokensDefaultRequired
FileThe 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.NoemptyYes

Differences by module​

Forms and ListingsAPIsUser Guides
File saved asFile IDPathPath
ChecksFails with an error if the file doesn't exist or belongs to another portalNoneNone
What happensThe 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 headerThe browser goes to the file in the same window
Popup and new tab optionsYesNoNo

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 Url token 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​

tip

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