Skip to main content



The Style Kit includes classes and a recommended implementation for using the Dropzone.js to upload multiple files.


This plugin depends upon:

See distribution for how to include these dependencies.

Server requirements

You will need an endpoint that can accept form submissions with file uploads, specifically the multipart/form-data encoding type.

In modern browsers this will trigger a CORS preflight request due to the use of a Non-CORS-safelisted request-headers. In addition to the Access-Control-Allow-Origin and Access-Control-Allow-Methods headers, you will need to include these header names in a Access-Control-Allow-Headers header:

  • Cache-Control
  • X-Requested-With

Header names are not case sensitive.


Drop-zones can be useful when multiple files need to be uploaded and allow users to add or remove files multiple times.

Standard file upload fields should be used instead of drop-zones where only a single file is needed as they are part of the HTML standard.


Click to select files or drag them here

There is a problem

One or more files could not be uploaded. If possible, fix the problem and try again.

    File Name
    File Size
    File Status
    Click to select more files or drag them here
    <form method="POST" enctype="multipart/form-data" action="">
      <fieldset class="bsk-form-group">
        <label class="bsk-control-label" for="dropzone-1">File upload (Drag and Drop)</label>
        <div id="dropzone-1" class="bsk-form-control bsk-dropzone">
          <div class="bsk-dropzone-upload-target bsk-target-initial">
            <div class="bsk-target-inner">Click to select files or drag them here</div>
          <div class="bsk-alert bsk-alert-block bsk-alert-outline bsk-alert-danger bsk-dropzone-errors-container">
            <h4>There is a problem</h4>
            <p>One or more files could not be uploaded. If possible, fix the problem and try again.</p>
            <br />
          <div class="bsk-dropzone-file-list">
            <div class="bsk-container-fluid">
              <header class="bsk-row bsk-dropzone-file-list-header">
                <div class="bsk-col-24-md-15">File Name</div>
                <div class="bsk-col-24-md-2">File Size</div>
                <div class="bsk-col-24-md-4">File Status</div>
                <div class="bsk-col-24-md-3 bsk-header-actions"> Actions</div>
              <div class="bsk-dropzone-file-list-items">
                <div class="bsk-row bsk-dropzone-file-list-item">
                  <div class="bsk-col-24-md-15" data-dz-name></div>
                  <div class="bsk-col-24-md-2" data-dz-size></div>
                  <div class="bsk-col-24-md-4" data-bsk-dz-status></div>
                  <div class="bsk-col-24-md-3 bsk-item-action-remove">
                    <a class="bsk-text-danger" href="#" data-dz-remove>Remove</a>
                  <div class="bsk-item-progress-bar" style="width:0%;" data-dz-uploadprogress></div>
              <div class="bsk-dropzone-upload-target bsk-target-additional">
                <div class="bsk-target-inner">Click to select more files or drag them here</div>

    The corresponding JavaScript for this example:

      // [General] Disable auto discover for all elements:
      Dropzone.autoDiscover = false;
      // [Dropzone 1] Prepare the file list
      var previewsTemplate1 = jQuery('#dropzone-1 .bsk-dropzone-file-list .bsk-dropzone-file-list-items').html();
      jQuery('#dropzone-1 .bsk-dropzone-file-list .bsk-dropzone-file-list-items').empty();
      // [Dropzone 1] Enable dropzone on specific element
      var dropzone1 = new Dropzone('#dropzone-1', {
        url: '',
        previewsContainer: '#dropzone-1 .bsk-dropzone-file-list-items',
        previewTemplate: previewsTemplate1,
        createImageThumbnails: false,
        clickable: "#dropzone-1 .bsk-target-inner"
      // [Dropzone 1] Add event listeners to add Style Kit specific classes
      dropzone1.on("addedfile", function(file) {
        jQuery('#' +'bsk-dropzone-started');
      dropzone1.on("reset", function(file) {
        jQuery('#' +'bsk-dropzone-started');
      // [Dropzone 1] Add event listeners to update file status for each file item
      dropzone1.on("processing", function(file) {
      dropzone1.on("uploadprogress", function(file, progress) {
        jQuery(file.previewElement).find('[data-bsk-dz-status]').text('Uploading (' + Math.round(progress) + '%)');
      dropzone1.on("success", function(file, message) {
      dropzone1.on("error", function(file, message, xhr) {
        jQuery('#' +'bsk-dropzone-errors');
        jQuery(file.previewElement).find('[data-bsk-dz-status]').addClass('bsk-text-danger').text('Upload Error');
        var errorMessage = '[' + xhr.status + '] ' + xhr.statusText;
        errorMessage = '<li data-bsk-dz-file-id="' + base64Encode( + '"><strong>' + + '</strong> - ' + errorMessage + '</li>';
        jQuery('#' +'.bsk-dropzone-errors-container ul').append(errorMessage);
      dropzone1.on("removedfile", function(file) {
        jQuery('#' +'.bsk-dropzone-errors-container ul li[data-bsk-dz-file-id="' + base64Encode( + '"]').remove();
        // Check if errors container is now empty
        if (jQuery('#' +'.bsk-dropzone-errors-container ul li').length < 1) {
          jQuery('#' +'bsk-dropzone-errors');