How to use

Copy-paste the following <script> near the end of your pages under JS Implementing Plugins to enable it.

              
                <script src="../assets/vendor/dropzone/dist/min/dropzone.min.js"></script>
              
            

Copy-paste the following <script> near the end of your pages under JS Front to enable it.

              
              
            

Copy-paste the init function under JS Plugins Init., before the closing </body> tag, to enable it.

              
                <script>
                  $(document).on('ready', function () {
                    // initialization of dropzone file attach module
                    $('.dropzone-custom').each(function () {
                      var dropzone = $.HSCore.components.HSDropzone.init('#' + $(this).attr('id'));
                    });
                  });
                </script>
              
            

Example

Methods

Parameters Description Default value

url

Has to be specified on elements other than form (or when the form doesn't have an action attribute). You can also provide a function that will be called with files and must return the url "../assets/include/dropzone-upload.html"

thumbnailWidth

If null, the ratio of the image will be used to calculate it. 300

thumbnailHeight

The same as thumbnailWidth. If both are null, images will not be resized. 300
Parameters previewTemplate
Description A string that contains the template used for each dropped file. Change it to fulfill your needs but make sure to properly provide all elements.
Default value
                          
                            $('<div>' +
                            '  <div class="col h-100 mb-5">' +
                            '    <div class="dz-preview dz-file-preview">' +
                            '      <div class="d-flex justify-content-end dz-close-icon">' +
                            '        <small class="tio-clear" data-dz-remove></small>' +
                            '      </div>' +
                            '      <div class="dz-details media">' +
                            '        <div class="dz-img">' +
                            '         <img class="img-fluid" data-dz-thumbnail>' +
                            '        </div>' +
                            '        <div class="media-body dz-file-wrapper">' +
                            '         <h6 class="dz-filename">' +
                            '          <span class="dz-title" data-dz-name></span>' +
                            '         </h6>' +
                            '         <div class="dz-size" data-dz-size></div>' +
                            '        </div>' +
                            '      </div>' +
                            '      <div class="dz-progress progress">' +
                            '        <div class="dz-upload progress-bar bg-success" role="progressbar" style="width: 0" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" data-dz-uploadprogress></div>' +
                            '      </div>' +
                            '      <div class="d-flex align-items-center">' +
                            '        <div class="dz-success-mark">' +
                            '          <span class="tio-checkmark-circle"></span>' +
                            '        </div>' +
                            '        <div class="dz-error-mark">' +
                            '          <span class="tio-checkmark-circle-outlined"></span>' +
                            '        </div>' +
                            '        <div class="dz-error-message">' +
                            '          <small data-dz-errormessage></small>' +
                            '        </div>' +
                            '      </div>' +
                            '    </div>' +
                            '  </div>' +
                            '</div>').html()