ftos.context.response.setDownload

IMPORTANT!  
Starting with v24.3, this is renamed from setDownload to ftos.context.response.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.

This is a routes method for business service components.

Syntax

Copy
function ftos.context.response.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