Basic Use of WebChart Server-Side Components > Temporary File Management |
The provided script files 2DGENTAG.INC and 3DGENTAG.INC include a routine to manage the temporary file component. For 2D this routine is called OlectraChart2D_AllocateTemporaryFile() and in 3D this routine is called OlectraChart3D_AllocateTemporaryFile() in 3D.
An instance of the temporary file allocation component is created on a per-session basis using the built-in ASP object instance creation method, Server.CreateObject . The single string parameter refers to the ProgID (registered name) of the WebChart temporary file allocator, which must be installed on the system. Sample code is as follows.
Example Title |
Copy Code
|
---|---|
Set TFA=Server.CreateObject("C1Chart8.ASPTemporaryFileAllocator")
|
Example Title |
Copy Code
|
---|---|
var TFA = Server.CreateObject("C1Chart8.ASPTemporaryFileAllocator"); |
A temporary file is obtained by using the Allocate() method. This returns a C1Chart8.ASPTemporaryFile object. Normally the files will be freed automatically, but they can be directly released by calling the Deallocate() method or the DeallocateAll() method.
The temporary file allocator frees temporary files automatically when the timeout expires. The timeout period is based on the Session timeout value. If a different timeout is required, it can be set on a per-file basis.