Top  | Previous | Next

system.file.getTempFile

Description

Creates a new temp file on the host machine with a certain extension, returning the path to the file. The file is marked to be removed when the Java VM exits.

Syntax

system.file.getTempFile(extension)

Parameters

String extension - An extension, like ".txt", to append to the end of the temporary file.

Returns

String - The path to the newly created temp file.

Scope

All

Examples

This code writes some data to a temorary file, and then opens that file. Assume that the data variable holds the contents of an excel (xls) file.

 

filename = system.file.getTempFile("xls"
system.file.writeFile(filename, data) 
system.net.openURL("file://" + filename)