DownloadFile
Download a file attached to a record.
Stored Procedure-Specific Information
This stored procedure supports downloading files from 'fileupload' and 'imageupload' fields. You can specify the download location using the DownloadPath parameter.
To execute this procedure, enter:
EXEC DownloadFile ModuleName = 'Contacts', RecordID = '100000000000000000', AttachmentID = '100000', DownloadPath='C:\\test.pdf';
You can also supply an instance of an output stream in the FileStream parameter.
When neither DownloadFile nor FileStream is supplied, the downloaded file is returned in the Content output parameter as a base64-encoded string.
Input
| Name | Type | Accepts Output Streams | Description |
| ModuleName | String | False | The API name of the module you are downloading an attachment for. |
| RecordID | String | False | Unique ID of the record you are downloading an attachment for. |
| AttachmentID | String | False | Unique ID of the attachment you are downloading. |
| DownloadPath | String | False | The Location of the file in which to save the attachment. |
| FileStream | String | True | An instance of an output stream where file data is written to. Only used if DownloadPath is not provided. |
Result Set Columns
| Name | Type | Description |
| Success | String | Returns True if the download succeeded. |
| Content | String | Base64-encoded content of the downloaded file, returned if DownloadPath is empty. |