setDownload
Downloads a file from the file upload location.
The function works by setting the navigation result to the corresponding download location. After the transaction completes, the client will download the file automatically.
Syntax
Copy
function setDownload(fileRealName : string, {entityName?: string, recordId?: string}): void;
| Parameter | Type | Description |
|---|---|---|
fileRealName
|
string | Unique internal ID of the file (real name). |
entityName (optional) |
string | Name of the entity that stores the file's corresponding attribute in the client-side context. In conjunction with the recordId attribute, this can speed up file retrieval. |
recordId (optional) |
string | ID of the record that stores the file's corresponding attribute in the client-side context. In conjunction with the entityName attribute, this can speed up file retrieval. |
Example
In this example, a download will be triggered in the user's browser for the TC_a9d136b3-9004-40a6-9dfc-a1e72448ebb0.pdf file, which is stored in the default upload location.