CustomDownloadURL - cLocalWebResourceManager
A lower level version of DownLoadURL. Used to generates a more customized unique and secure URL from downloading a file
Type: Function
Return Data Type: String
Parameters
| Parameter | Type | Description |
|---|---|---|
| sPath | String | The local full path name of the file to be loaded to your client |
| bAttachment | Boolean | If True, the file will be streamed as an attachment; if False, inline. Streaming as attachment will show the 'save as' dialog. |
| sDownloadFileName | String | Allows to send the file with a custom name instead of a default file name |
| iTimeout | Integer | Number of hours that the URL stays valid |
Syntax
Function CustomDownloadURL String sPath Boolean bAttachment String sDownloadFileName Integer iTimeout Returns String
Call Example
Get CustomDownloadURL sPath bAttachment sDownloadFileName iTimeout to StringVariable
Description
CustomDownloadURL allows you to generate a unique and secure URL with the ability to apply special options, such as: invoking the Save As dialog at the client, changing the file name at the client, allowing the URL to be used with any client session ID, setting a timeout for the URL.
Sample
The following example demonstrates how to download a file and invoke the Save As dialog to save it on the client.
Object oButton is a cWebButton
Set psCaption to "Save Prices"
Procedure Ok
String sPath sUrl
Move "c:\Catalog\Pricelist.pdf" to sPath
// Builds an encrypted URL based on the file path
Get CustomDownloadURL of ghoWebResourceManager sPath True "" True 0 to sUrl
// load the file in the cWebIFrame object in the frame
Send NavigateToPage to ghoWebApp sUrl btNewWindow
End_Procedure
End_Object
You can usually use DownloadURL to handle most downloads.