isSpreadsheetFile

Checks if the input is a spreadsheet file or not

isSpreadsheetFile(value) → returns boolean

This function requires Adobe ColdFusion 9 and up.  Not supported on Lucee, etc.

Argument Reference

value string
Required

A file path

Examples
Sample code invoking the isSpreadsheetFile function

Here we have simple example to check if the given file is a spreadsheet or not.

<form method="post" enctype="multipart/form-data">
	<input type="file" name="myfile" />
	<input type="submit" name="submit" value="submit">
</form>
<cfif structKeyExists(form, "submit")>
	<cfif isSpreadsheetFile(form.myfile)>
		<cffile action="upload" destination="#getTempDirectory()#" filefield="form.myfile" nameconflict="makeunique">
	</cfif>
</cfif>

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub