Skip to main content
Version: 4.62

downloadFile

Downloads a file to the device's local storage. To skip the completion, async has to be used.

Field Configurations

KeyTypeDescriptionDefault Value
"params" (required)Objectundefinednull

Parameters

KeyTypeDescriptionDefault Value
"additionalHeaders"AdditionalHeadersAdditional HTTP headers which will be appended to the request.null
"async"BooleanSpecifies whether the action should perform asynchronously.null
"extensionFromRequest"String,BooleanIndicates whether or not the file extension should be inferred from the mime type of downloaded file.false
"field"StringThe name of the field.null
"fileExtension"StringThe type of the file to be downloaded.null
"name"StringOptional name to use as the file name for the downloaded file.null
"progressBarBackground"ColorThe background color of the progress bar when a file is loaded.null
"progressBarColor"ColorThe color of the progress bar when a file is loaded.null
"query"StringThe name of the query.null
"queryParams"ArrayThe list of the appended query parameters.null
"table"StringThe name of the database table.null
"url"StringThe URL of the file to be downloaded.null
"urls"ArrayThe list of file URL's to be downloaded.null

Inherited

From Base Action

Base Action

Field Configurations

KeyTypeDescriptionDefault Value
"dynamicParams"ObjectDynamic params to retrieve data from a specific context e.g. a userSetting.null
"leadingDelimiter"StringThe leading mustache delimiter to use.null
"params"Object,ArrayObject containing the properties of the action.null
"trailingDelimiter"StringThe trailing mustache delimiter to use.null
"type"StringType name of the action.null

Examples

Example 1: Download a PDF file to the local storage.

Show ExampleHide Example

Goal: Create a downloadFile action that will download a PDF document.

Url, field and fileExtension keys have to be assigned within the params object of the action.

{
"type": "downloadFile",
"params": {
"url": "https://example.mobilitysuite.de/pdf",
"field": "file",
"fileExtension": "pdf"
}
}