ChartDirector Ver 4.1 (ColdFusion Edition)
BaseChart.makeTmpFile
Usage
makeTmpFile(dirname [, imageFormat [, lifeTime ]])
Description
Generates the chart as an image and save it to a temporary file, and automatically remove old files.
The makeTmpFile method creates the temporary file in the directory specified by dirname. To avoid building up of too many temporary files, it will automatically remove all files older than a certain life time (default 600 seconds) in that directory.
Note that makeTmpFile expects a file system path of the directory, not a URL path. You may use the ColdFusion "ExpandPath" function to translate a URL path to a file system path.
Please ensure the temporary file directory exists and is readable and writable by the web server anonymous user. ChartDirector will not create the directory. By default, most systems are configured to deny anonymous user write access to any web server directory. You may need to modify your security settings to allow "everyone" to write to the temporary file directory.
If makeTmpFile is unsuccessful, an empty string will be returned. In this case, please check that the temporary directory exists, and is readable and writable by the web server anonymous user, and "ExpandPath" has been used to map URLs to path names.
It is highly recommended you use a dedicated directory for storing temporary files created by ChartDirector. This is to avoid makeTmpFile from accidentally removing old files belonging to other applications.
Arguments
Argument | Default | Description |
dirname | (Mandatory) | The directory to store the temporary file and to remove old files. |
imageFormat | PNG | A constant representing the format of the image. Must be one of the predefined constants PNG, JPG, GIF, BMP or WMP. |
lifeTime | 600 | The life time of files in seconds. Older files will be deleted. A negative value disables automatic temporary file removal. |
Return Value
The temporary file name (not including the path), or an empty string in case of failure.
© 2006 Advanced Software Engineering Limited. All rights reserved.