title: Dropzone remove previous image
body: <p>I'm needing help with an answer to a previous question
  <a href="https://stackoverflow.com/questions/18048825/how-to-limit-the-number-of-dropzone-js-files-uploaded/19057630#19057630">How to limit the number of dropzone.js files uploaded?</a></p>
  
  <p>where there was a solution to use</p>
  
  <pre><code>Dropzone.options.myAwesomeDropzone = {
    accept: function(file, done) {
      console.log("uploaded");
      done();
    },
    init: function() {
      this.on("addedfile", function() {
        if (this.files[1]!=null){
          this.removeFile(this.files[0]);
        }
      });
    }
  };
  </code></pre>
  
  <p>But being a js numpty, I don't know where to put this. I assume that my form must have the id myAwesomeDropzone and that the code above needs to be slotted into the dropzone.js document, but where? if you could provide a 'after' and 'before' or replace answer please.</p>
  
  <p>If someone could give me some pointer it'd be great. </p>
  
  <p>My reputation is less than 50 so I couldn't comment on the original thread. If me posting this as a new thread is wrong, please admins don't just chastise me and close it, but move it or do whatever to allow people to provide help accrodingly.</p>
  
  <p>Cheers
  Andy</p>