Logo v4.3.1
Image Description

No Results

  • Get Support
  • Preview Demo
Logo v4.3.1
  • Docs
  • Snippets
  • Documentation
  • Introduction
  • Getting started
  • Getting Started
  • Gulp
  • Customization
  • Credits
  • Changelog
  • Design & Graphics
  • Bootstrap Icons
  • Duotone Icons
  • Illustrations
  • Components
  • Accordion
  • Alerts
  • Avatars
  • Badge
  • Breadcrumb
  • Buttons
  • Cards
  • Collapse
  • Column Divider
  • Devices
  • Divider
  • Dropdowns
  • Icons
  • List Group
  • Lists
  • Legend Indicator
  • Modal
  • Offcanvas
  • Page Header
  • Pagination
  • Popovers
  • Progress
  • Profile
  • Shapes
  • Spinners
  • Steps
  • Tab
  • Tables
  • Text Highlight
  • Toasts
  • Tooltips
  • Typography
  • Navbars
  • Navbar
  • Navs
  • Mega Menu
  • Scrollspy
  • Basic forms
  • Basic Forms
  • Checks & Switches
  • Input Group
  • Advanced Forms
  • Advanced Select
  • File Attachments
  • Drag’ n’ Drop File Uploads
  • WYSIWYG Editor
  • Quantity Counter
  • Input Mask
  • Step Forms (Wizards)
  • Range Slider (noUiSlider)
  • Add Field
  • Toggle Password
  • Count Characters
  • Toggle Switch
  • Toggle State
  • Switch
  • Media
  • Fullscreen Lightbox
  • Video Background
  • Video Player
  • Swiper
  • Others
  • Maps (Leaflet)
  • Chart.js
  • Circles.js (Pie Chart)
  • Sticky Block
  • Countdown
  • Sorting (Shuffle.js)
  • Go To
  • Show Animation
  • Typed.js
  • Utilities
  • Backgrounds
  • Borders
  • Colors
  • Links
  • Position
  • Rotations
  • Shadows
  • Sizing
  • Spacing
  • Z-index

Drag’ n’ Drop File Uploads

Drag'n'drop file-attach uploads with image previews.

Dropzone.js documentation

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>
            (function() {
              // INITIALIZATION OF DROPZONE
              // =======================================================
              HSCore.components.HSDropzone.init('.js-dropzone')
            })()
          </script>
        
      

Basic example

  • Preview
  • HTML
Drag and drop your file here

or

Browse files
              
                <form>
                  <!-- Dropzone -->
                  <div id="basicExampleDropzone" class="js-dropzone row dz-dropzone dz-dropzone-card">
                    <div class="dz-message">
                      <span class="svg-icon svg-icon-lg mb-3">
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        
                        

                      </span>

                      <h5>Drag and drop your file here</h5>

                      <p class="mb-2">or</p>

                      <span class="btn btn-white btn-sm">Browse files</span>
                    </div>
                  </div>
                  <!-- End Dropzone -->
                </form>
              
            

Modal example

  • Preview
  • HTML
Dropzone
Drag and drop your file here

or

Browse files
              
                <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">Open modal</button>

                <!-- Modal -->
                <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
                  <div class="modal-dialog">
                    <div class="modal-content">
                      <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel">Dropzone</h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                      </div>

                      <div class="modal-body">
                        <form>
                          <!-- Dropzone -->
                          <div id="modalDropzone" class="js-dropzone row dz-dropzone dz-dropzone-card">
                            <div class="dz-message">
                              <span class="svg-icon svg-icon-lg mb-3">
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                
                                

                              </span>

                              <h5>Drag and drop your file here</h5>

                              <p class="mb-2">or</p>

                              <span class="btn btn-white btn-sm">Browse files</span>
                            </div>
                          </div>
                          <!-- End Dropzone -->
                        </form>
                      </div>

                      <div class="modal-footer">
                        <button type="button" class="btn btn-white" data-bs-dismiss="modal">Close</button>
                        <button type="button" class="btn btn-primary">Save changes</button>
                      </div>
                    </div>
                  </div>
                </div>
                <!-- End Modal -->
              
            

Methods

Parameters Description Default value

allowTypes

Supported file types. If empty all supported. []

maxFileSize

Max size for uploading file. 1024

mode

Supported two mods (image/simple). image - show image after uploading. simple - show file name after uploading. simple

targetAttr

Element selector with src for image mode. null

textTarget

Element selector for simple mode. null

resetTarget

Element selector to reset form. null

errorMessage

Error message text if the file size is larger than the allowed. 'File is too big!'

typeErrorMessage

Error message text if file type is not supported. 'Unsupported file type'