HTML5 file uploader.

0.0.16 2017-01-20 20:23 UTC

This package is auto-updated.

Last update: 2022-07-06 18:56:54 UTC


Upload files using html5.

Table of contents

Quick start

Several quick start options are available:

What's included

Within the download you'll find the following directories and files, logically grouping common assets and providing both compiled and minified variations. You'll see something like this:

├── html5-uploader.js
├── html5-uploader.min.js


Example file upload and usage:


<!-- Include jQuery Beforehand -->
<script src="html5-uploader.js"></script>
    <input type="file" name="file"/>

To override loaded javascript configuration settings, you will need to add data-* tags to the file (input) field. The setting accept may be set without data- attribute prefix.

Available options

  • accept: array|string Mime-types that you wish to accept.
    • Alternatively you may provide accept tag in the file (input) field that will be translated internally. (Nothing fancy though...)
  • fields: array|string Extra fields you wish to post.
    • Alternatively you may provide a string assigned as key=value|key=value|.. in a data-fields attribute.
  • holder: string Element name where you drag and drop files to.
  • preview: object|string Create your own preview function.
  • progress: object|string Create your own progress function.
  • url: string The url where the form data will post to.
  • name: string The name of the form data will post as.
  • complete: object|string Create your own completion function.
  • debug: boolean Show console.log report in browser.
<input type="file" accept="image/png|image/jpeg|image/gif" data-url="upload.asp" data-fields="customFields" data-holder=".drag-n-dro-here" data-progress="customProgress" data-preview="customPreview" data-complete="customComplete">


<!-- alternate data-fields -->"token=ju3Fn55d24sADfa|type=image"..
  name: 'file',
  accept: [
  url: 'upload.asp',
  fields: [
    token: 'ju3Fn55d24sADfa'
  holder: '.drag-n-drop-here',
  progress: function(complete) {
    console.log('File is uploading. Currently at '+complete+'%');
  preview: function(file){
    console.log('Would you look at this file.', file);
  complete: function(file, response) {
    console.log('File uploaded.');
  debug: false