DownloadFile
A DownloadFile() function causes a specified file to be downloaded.
Warning! This function can be used only in a manual rule called on a case form. When function is used in the manual rule called from a report (group rules functionality) it has no effect. It means that no file will be donwloaded (from the report).
DownloadFile(fieldName);DownloadFile(attachmentName);DownloadFile(stringContent, fileName);Arguments
Dział zatytułowany „Arguments”- fieldName|attachmentName – (String) a name of the document-type field or a name of the file attached to the case;
- stringContent – (String) a string content that will be downloaded under the given file name;
- fileName – (String) a name of the file that will be returned containing the given string content.
Return Value
Dział zatytułowany „Return Value”Returns true.
Type: Boolean
Examples
Dział zatytułowany „Examples”Example 1
Dział zatytułowany „Example 1”This will download file from the „Invoice” field on the case form.
DownloadFile("Invoice");Example 2
Dział zatytułowany „Example 2”This will download a document with name „invoice.pdf” from the attachment list on the case form.
DownloadFile("invoice.pdf");Example 3
Dział zatytułowany „Example 3”This will download the given text as a „sample_file.txt” file.
DownloadFile("a sample text to be downloaded as a file","sample_file.txt");Example 4
Dział zatytułowany „Example 4”This will download the given base64 encoded string (assuming that it is a generated ZIP content) as „invoice.zip” file.
DownloadFile(base64Content,"invoice.zip");