Whatever message this page gives is out now! Go check it out!

ColdFusion.FileUpload.clearAllFiles

Last update:
May 18, 2026

Description

Before upload or after you cancel upload, you can choose to clear all the files selected for upload. When you do this, the selected files are removed from the Upload view list.

Function syntax

ColdFusion.FileUpload.clearAllFiles(name)

See also

History

ColdFusion 9: Added this function

Parameters

Parameter
Description
name
The value of the name attribute in the cffileupload tag.

Returns

This function does not return a value.

Example

This example includes a button for the ClearAllFiles action. When you click this button, the files selected for upload are removed.
<h3>This is an example of the FileUpload.clearAllFiles function. Add a few files to upload and click Upload. During upload, click the Clear Upload HTML button to clear all the files selected for upload.</h3> 
 <script language="JavaScript" type="text/javascript"> 
 function onClear() { 
 ColdFusion.FileUpload.clearAllFiles('myupload'); 
 }; 
 </script> 
 <cffileupload 
 url="uploadAll.cfm" 
 progressbar="true" 
 name="myupload" 
 addButtonLabel = "Add File" 
 clearButtonlabel = "Clear it" 
 width=600 
 height=400 
 title = "File Upload" 
 maxuploadsize="30" 
 extensionfilter="*.jpg, *.png, *.flv, *.txt" 
 BGCOLOR="##FFFFFF" 
 MAXFILESELECT=10 
 UPLOADBUTTONLABEL="Upload now"/> 
 <cfform name="form01"> 
 <cfinput type="button" name="clearupload" value="Cancel Upload" 
 onclick="onClear()"> 
 </cfform>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page