title: Uploadify: Get file id and cancel upload if duplicate is detected
body: <p>I am running uploadify in my site. It works as it is intended to do but I want it to automatically cancel uploads if I detected that the file being uploaded is already in the system.</p>
  
  <p>I have a table in the database the logs all of the files that was uploaded. I can just find that file name and if it matched I will tell uploadify to cancel that file.</p>
  
  <p>With that said and done, I am puzzled on how to tell uploadify to cancel automatically.</p>
  
  <p>I would use the event onUploadStart to check if the filename exists in the DB. Then I would use the cancel method as indicated in the documentation. The problem with this is how to get the file id of the active file.</p>
  
  <pre><code>$('#file-upload').uploadify({
                  'checkExisting' : '&lt;? echo base_url('source/upload/check-exists.php'); ?&gt;',
                  'swf'      : '&lt;? echo base_url('source/upload/uploadify.swf'); ?&gt;',
                  'uploader' : '&lt;? echo base_url('source/upload/uploadify.php'); ?&gt;',
                  'fileTypeDesc' : 'PDF Files',
                  'fileTypeExts' : '*.pdf',
                  'onUploadComplete' : function (file) {
                      var fileid = file.id;
                      $(this).uploadify('cancel');
                  }
                  // Put your options here
              });
  </code></pre>
  
  <p>I am not sure if I am doing it correct.</p>
  
  <p>Thanks.</p>