Downloads an attachment file.

This statement instructs Convertigo to wait for an attachment to be fully downloaded. This statement requires the Convertigo internal browser to be set so as to receive attachments, by using an appropriate Browser property change statement.
The required property must be changed prior to executing the action that triggers the download (click on a download link for example). The property change can be included either in a previous transaction or in a handler executed prior to the download.
Important note: Get attachment statement must be executed immediately after the action that triggers the download.
Once the download is complete, the final destination for the retrieved document depends on the Attachment recovery policy property value:

• If the property is set to localfile_<whatever_value>, the file is stored locally in a temporary file, using the path defined by the File path property.
• If the property is set to base64, the file is stored in memory encoded in base 64.

Note: The file can be sent back to the client afterwards as binary data with the correct MIME type: the client should request Convertigo .bin requester (see the "Interfaces to Convertigo" chapter of the Reference Manual, "HTTP protocol interface to Convertigo" section, "Convertigo URLs">"Convertigo requesters" paragraph).

Property Type Category Description
Attachment recovery policy Policy standard Defines how and where to recover the attachment file.
This property can take one of the following values:

localfile_increment: stores the downloaded file locally on the server, using the File path property; if a file with the same name has already been downloaded, it increments the name of the file with a number in order not to lose previous version,
localfile_override: stores the downloaded file locally on the server, using the File path property; if a file with the same name has already been downloaded, it overrides the previously downloaded file with the new version,
base64: stores the downloaded file in memory, encoded in base 64.

The localfile_override policy is the default value for this property.
Comment String standard Describes the object comment to include in the documentation report.
This property generally contains an explanation about the object.
File path JS expression standard JavaScript expression defining the file path, including the file name, of the file to get (optional).
If set, this property allows to override the initial file name and to define the path to the directory where the file must be get. This path is either absolute or relative to Convertigo environment. Relative paths starting with:

./ are relative to Convertigo workspace,
.// are relative to current project folder.

If not set, a default path is automatically generated: .//downloads/<original_name_from_the_server>. This path automatically creates a downloads folder in the project (if not existing) and stores in it the file with its original name suggested by the server.
Is active boolean standard Defines whether the statement is active.
Threshold long standard Defines the downloading activity threshold in millisecond.
The HTML connector cannot know when a file download is terminated. On the other side, the HTML connector knows about downloading activity.
This property allows to define a maximum time of inactivity to wait after the last downloading activity. If this threshold time is reached, the file download is considered as finished.
Timeout long standard Defines the download timeout in millisecond.
This property allows to define the maximum time to wait for the file to be downloaded. If the file download is not finished at the end of this time, the download is aborted.