Single File Upload
========== HTML ========== <div class="custom-file-container" data-upload-id="myFirstImage"> <label>Upload (Single File) <a href="javascript:void(0)" class="custom-file-container__image-clear" title="Clear Image">x</a></label> <label class="custom-file-container__custom-file" > <input type="file" class="custom-file-container__custom-file__custom-file-input" accept="image/*"> <input type="hidden" name="MAX_FILE_SIZE" value="10485760" /> <span class="custom-file-container__custom-file__custom-file-control"></span> </label> <div class="custom-file-container__image-preview"></div> </div>
================= Javascript ================= //First upload var firstUpload = new FileUploadWithPreview('myFirstImage')
Multiple File Upload
========== HTML ========== <div class="custom-file-container" data-upload-id="mySecondImage"> <label>Upload (Allow Multiple) <a href="javascript:void(0)" class="custom-file-container__image-clear" title="Clear Image">x</a></label> <label class="custom-file-container__custom-file" > <input type="file" class="custom-file-container__custom-file__custom-file-input" multiple> <input type="hidden" name="MAX_FILE_SIZE" value="10485760" /> <span class="custom-file-container__custom-file__custom-file-control"></span> </label> <div class="custom-file-container__image-preview"></div> </div>
================= Javascript ================= //Second upload var secondUpload = new FileUploadWithPreview('mySecondImage')
Copyright © 2020 DesignReset, All rights reserved.
Coded with