Documentation
setExtension
usage
$tempfile->setExtension( string extension )
paramètres
extension : the file extension you want to add at the end of the filename.
exemples
include('../Kernel/common/file.class.php');
$file = new TempFile();
$file->setExtension('txt');
$file->save('Hello world');
$file->forceDownload();