Print

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).

Syntax

DownloadFile(fieldName);
DownloadFile(attachmentName);
DownloadFile(stringContent, fileName);

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

Returns true.

Type: Boolean

Examples

Example 1

This will download file from the „Invoice” field on the case form.

DownloadFile("Invoice");

Example 2

This will download a document with name „invoice.pdf” from the attachment list on the case form.

DownloadFile("invoice.pdf");

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

This will download the given base64 encoded string (assuming that it is a generated ZIP content) as „invoice.zip” file.

DownloadFile(base64Content,"invoice.zip");

 

Czy artykuł był pomocny?
0 na 5 gwiazdek
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
5
How can we improve this article?
How Can We Improve This Article?