Download Helper
The Download Helper lets you download data to your desktop.
Loading this Helper
This helper is loaded using the following code:
rigLoadHelper "download"
The following handlers are available:
rigForceDownload "filename", "data"
Generates server headers which force data to be downloaded to your desktop. Useful with file downloads.
Parameters
- filename: is the name you want the downloaded file to be named
- data: is the file data
Example:
put "Here is some text!" into tData
put "mytext.txt" into tName
rigForceDownload tName, tData
If you want to download an existing file from your server you'll need to read the file into a string:
put rigFile_get_contents("/path/to/photo.jpg") into tData -- Read the file's contents
put "myphoto.jpg" into tName
rigForceDownload tName, tData