User Guide Cancel

StreamingspreadsheetCleanup

 

Disclaimer

Some older methods for reading and writing spreadsheets may not work for streaming spreadsheet objects if they attempt to operate on rows that are not yet loaded into memory at the time of invocation.

Description

Removes the temporary files written to disk while performing operations on a streaming spreadsheet.

Returns 

True, on successful removal of the files.

History

  • ColdFusion (2025 release): Added the function.

Syntax

streamingSpreadsheetCleanup(source)
streamingSpreadsheetCleanup(source)
streamingSpreadsheetCleanup(source) 

Parameters

Name Required Type Description
spreadsheetObj Yes String The file path of the streaming spreadsheet whose temporary files are to be cleaned.
Important

Once this method is invoked, the streaming spreadsheet object cannot be used further. It is recommended to call it only after completing all necessary operations and writing the object to disk.

Example

In this example, the streamingspreadsheetcleanup function cleans all the temp files generated when creating the streaming spreadsheet.

<cfscript>
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "file-stream.xlsx";
obj = streamingSpreadsheetNew("data")
try{
streamingspreadsheetcleanup(obj)
writeOutput("Streaming spreadsheet" & theFile & " is successfully cleaned")
}
catch(any e){
writeDump(e)
}
</cfscript>
<cfscript> theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "file-stream.xlsx"; obj = streamingSpreadsheetNew("data") try{ streamingspreadsheetcleanup(obj) writeOutput("Streaming spreadsheet" & theFile & " is successfully cleaned") } catch(any e){ writeDump(e) } </cfscript>
<cfscript> 
    theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "file-stream.xlsx"; 
    obj = streamingSpreadsheetNew("data") 
    try{ 
        streamingspreadsheetcleanup(obj) 
        writeOutput("Streaming spreadsheet" & theFile & " is successfully cleaned") 
    } 
    catch(any e){ 
        writeDump(e) 
    } 
</cfscript> 

Get help faster and easier

New user?