title: How do I detach Dropzone programmatically?
body: <p>I use Dropzone to upload files client side. I have set up Dropzone programmatically using JQuery and I would like to be able to detach it so the user can no longer upload anymore files. My ideal solution is to simply make it unclickable then apply a default message to indicate to the user they have exceeded the number of uploads.</p>
  
  <p>Here is a simple example:
  <a href="http://www.dressorganic.co.uk/dropzone-test/turn-off-dropzone-after-load.htm" rel="nofollow">http://www.dressorganic.co.uk/dropzone-test/turn-off-dropzone-after-load.htm</a></p>
  
  <p>Here I try to make it unclickable after the success event but nothing happens.</p>
  
  <p>Here is a link to what I actually want it to look like after a successful upload:
  <a href="http://www.dressorganic.co.uk/dropzone-test/dropzone-disabled.htm" rel="nofollow">http://www.dressorganic.co.uk/dropzone-test/dropzone-disabled.htm</a></p>
  
  <pre><code>    &lt;!DOCTYPE html&gt;
      &lt;head&gt;
      &lt;meta charset="utf-8"&gt;
      &lt;title&gt;Turn off Dropzone after load&lt;/title&gt;
      &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="/dropzone-test/dropzone/4.0.1/dist/min/dropzone.min.js"&gt;&lt;/script&gt;
      &lt;link rel="stylesheet" href="/dropzone-test/dropzone/4.0.1/dist/min/dropzone.min.css"&gt;
  
      &lt;script type="text/javascript"&gt;
      //&lt;![CDATA[
      $(function() {
  
         $("#upload1").dropzone({
            createImageThumbnails : false,
            url: "/dropzone-test/handleupload.asp",
            acceptedFiles : ".jpg,.jpeg,.png,.gif",
            dictDefaultMessage : "Click here or drag and drop files to upload",
            addRemoveLinks : false,
            success : function(file) {
               this.removeAllFiles();
  
               $("#upload1").dropzone({
                   clickable : false,
                   url: "/dropzone-test/handleupload.asp",
                   dictDefaultMessage : "You have exceeded the number of uploads, please remove existing to add more"
                });
  
            },
          });
  
      });  // JQuery
      //]]&gt;
      &lt;/script&gt;
  
      &lt;/head&gt;
  
      &lt;body&gt;
  
          &lt;div id="singleproductload"&gt;
  
              &lt;div id="upload1" class="dropzone"&gt;
  
              &lt;/div&gt;
  
          &lt;/div&gt;
  
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>