💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[![Uploadify - JQuery File Upload Plugin Script](https://box.kancloud.cn/2015-11-02_5636cc82d8b6c.png)](http://www.uploadify.com) # onCheck Input Type:**function** Input Format:**function() {}** Required:**optional** The **onCheck** option allows you to execute a function when a file with the same name is found on the server. The check begins right before the files are uploaded. The default function prompts the user for confirmation of upload over the existing file and cancels the upload if not confirmed. If your custom function returns **false**, the default function will not run. The **checkScript** option must be used in tandem with this option. ### Arguments **event** The event object. **data** An object containing the list of file names that exist on the server. The key for each file name is the unique ID of the queue item. **key **The unique ID queue item for the file that was detected on the server. ### Notes To cancel a file upload, use the following line in your function: ~~~ document.getElementById(jQuery(event.target).attr('id') + 'Uploader').cancelFileUpload(key,true,true); ~~~ ### Demo Javascript Code 1. $('#file_upload').uploadify({ 1.   'uploader'    : '/uploadify/uploadify.swf', 1.   'script'      : '/uploadify/uploadify.php', 1.   'cancelImg'   : '/uploadify/cancel.png', 1.   'folder'      : '/uploads', 1.   'checkScript' : '/uploadify/check.php', 1.   'onCheck'     : function(event,data,key){ 1.       $('#file_upload' + key).find('.percentage').text(' - Exists'); 1.     } 1. }); HTML Code 1. <inputtype="file"id="file_upload"name="file_upload"/> 1. <ahref="javascript:$('#file_upload').uploadifyUpload();">Upload Files</a> [Upload Files](#) [![Download the Latest Version](https://box.kancloud.cn/2015-11-02_5636cc82ea7d9.png)](#) Help keep Uploadify free and support the development of other excellent apps! ![](../image/564003e12280d.gif) [home](#)  |  [about](#)  |  [download](#)  |  [demos](#)  |  [documentation](#)  |  [faqs](#)  |  [forums](#) ©2011 by [Reactive Apps](http://www.reactiveapps.com)