How many times do you add append uploaded? And the replacement of attr src?

I wrote one after the user uploaded the video and selected it

$("input[type=file]").change(function() {
      var input = $(this);
      if(!!this.files && !!this.files[0]) {
        var reader = new FileReader();
      reader.onload = function(e) {
          $("-sharppre" + input.prop("id").substr(4,2)).prop("src", e.target.result);
      }
      reader.readAsDataURL(this.files[0]);
    }
  });

will be directly reflected in the-sharppreXX face and displayed directly

<input type="file" id="file01" name="" class="" accept="image/jpeg, image/png, image/jpg">
<img src="" id="pre01" class="">

I just have a problem now
I need a function of jquery append now
can add several uploads
but in this way my file01 cannot use
god, how should I deal with this problem?
and I want to add this addition
means that this piece of noodles (and more)

<input type="file" id="file01" name="" class="" accept="image/jpeg, image/png, image/jpg">
<img src="" id="pre01" class="">

may change this:

$("select").append("<input type="file" id="file01" name="" class="" accept="image/jpeg, image/png, image/jpg"><img src="" id="pre01" class="">");

would this be the right thing to do?


  WebUploader , most component libraries contain upload plug-ins 

Menu