title: Dropzonejs trigger error and cancel upload
body: <p>i'm using Dropzonejs and what I would like to do is essentially simple. But I can't find any article about it.   </p>
  
  <p>So on sending the file we trigger an error on nasty .exe and .php files. The dropzonejs interface show an X and and error message. So that's correct. The problem is that it still gets thrown into the on success event, and gets uploaded.</p>
  
  <pre><code>uploader.on("sending", function (file, xhr, data) {
  
      var aDeny = [ // deny file some extensions by default
          'application/x-msdownload',
          'text/php'
      ];
  
      if($.inArray(file.type, aDeny) !== -1) {
          this.defaultOptions.error(file, 'File not allowed: ' + file.name);
          return false;
      }
  });
  </code></pre>
  
  <p>Evil.exe still appears in this success event and gets uploaded. The response only has a string of the file path and file.status is success.</p>
  
  <pre><code>uploader.on('success', function (file, response) {
  
      getData({'dostuff'});
  
      return file.previewElement.classList.add("dz-success");
  });
  </code></pre>
  
  <p>So in my 'sending' event, how can I prevent the file from appearing in the success event?</p>
  
  <p>UPDATE:</p>
  
  <p>Thanks! This is what I needed in the end:</p>
  
  <pre><code>var aDeny = [ // deny file some extensions by default
      'application/x-msdownload',
      'text/php'
  ];
  
  Dropzone.options.uploadWidget = {
      // more config...
      accept: function (file, done) {
          if ($.inArray(file.type, aDeny) !== -1) {
              done("This file is not accepted!");
          }
          else {
              done();
          }
      }
  }
  </code></pre>