DownloadDocument
Downloads a document by its document Id.
Procedure Specific Information
Downloads a document by its document Id. The DocumentId parameter is required. The file can be saved to a local path via DownloadLocation, written to a stream via FileStream, or returned as base64-encoded data in the FileData output column. The procedure is executed as below:
EXEC DownloadDocument DocumentId = 'doc-123', DownloadLocation = 'C:/temp/document.pdf'
EXEC DownloadDocument DocumentId = 'doc-123'
You can also supply an instance of an output stream in the FileStream parameter.
When neither DownloadLocation nor FileStream is supplied, the downloaded file is returned in the FileData output column as a base64-encoded string.
Input
| Name | Type | Description |
| DocumentId | String | The Id of the document to download. |
| DownloadLocation | String | The local full file path to save the downloaded file. |
Result Set Columns
| Name | Type | Description |
| FileData | String | The base64-encoded file data. Only populated if DownloadLocation and FileStream are not set. |
| Status | String | The status of the operation. |