onCancel
function
function(event,ID,fileObj,data) {}
optional
The onCancel option allows you to run a custom function when a file upload is canceled. The default function removes the file item from the queue. This function will also fire for each file when the queue is cleared. If the custom function returns false, the default function will not run.
Arguments
event
The event object.
ID
The unique identifier of the file that was cancelled.
fileObj
An object containing details about the file that was selected.
- [name] – The name of the file
- [size] – The size in bytes of the file
- [creationDate] – The date the file was created
- [modificationDate] – The last date the file was modified
- [type] – The file extension beginning with a '.'
data
Details about the file queue.
- [fileCount] – The total number of files left in the queue
- [allBytesTotal] – The total number of bytes left for all files in the queue
Demo
Javascript Code
- $('#file_upload').uploadify({
- 'uploader' : '/uploadify/uploadify.swf',
- 'script' : '/uploadify/uploadify.php',
- 'cancelImg' : '/uploadify/cancel.png',
- 'folder' : '/uploads',
- 'onCancel' : function(event,ID,fileObj,data) {
- alert('The upload of ' + fileObj.name + ' has been canceled!');
- }
- });
HTML Code
- <input type="file" id="file_upload" name="file_upload" />
- <a href="javascript:$('#file_upload').uploadifyUpload();">Upload Files</a>

