Fancy Responsive File Uploader For jQuery - FancyFileUpload

Fancy Responsive File Uploader For jQuery - FancyFileUpload
File Size: 47.4 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A fancy, file uploader plugin based on the jQuery File Upload plugin that converts the normal file input into a responsive, mobile-friendly uploader interface with support for drag'n'drop, keyboard interactions, file preview,  Chunked file upload and much more. Dual licensed under the MIT or LGPL.

How to use it:

1. Load the primary CSS file 'fancy_fileupload.css' in the head section of the webpage.

<link rel="stylesheet" href="fancy_fileupload.css">

2. Load the file uploader plugin's script and other required JavaScript files at the end of the document.

<script src="//code.jquery.com/jquery.min.js"></script>
<script src="jquery.ui.widget.js"></script>
<script src="jquery.fileupload.js"></script>
<script src="jquery.iframe-transport.js"></script>
<script src="jquery.fancy-fileupload.js"></script>

3. Call the plugin on the file input field and done. You're allowed to specify the types of files that the server accepts:

<input id="demo" type="file" name="files" accept=".jpg, .png, image/jpeg, image/png" multiple>
$('#demo').FancyFileUpload({
  params : {
    action : 'fileuploader'
  },
  maxfilesize : 1000000
});

4. All possible plugin options to customize the file uploader.

$('#demo').FancyFileUpload({

  // send data to this url
  'url' : '',

  // key-value pairs to send to the server
  'params' : {},

  // editable file name?
  'edit' : true,

  // max file size
  'maxfilesize' : -1,

  // a list of allowed file extensions
  'accept' : null,

  // 'iec_windows', 'iec_formal', or 'si' to specify what units to use when displaying file sizes
  'displayunits' : 'iec_windows',

  // adjust the final precision when displaying file sizes
  'adjustprecision' : true,

  // the number of retries to perform before giving up
  'retries' : 5,

  // the base delay, in milliseconds, to apply between retries
  'retrydelay' : 500,

  // called for each item after it has been added to the DOM
  'added' : null,

  // called whenever starting the upload
  'startupload' : null,

  // called whenever progress is updated
  'continueupload' : null,

  // called whenever an upload has been cancelled
  'uploadcancelled' : null,

  // called whenever an upload has successfully completed
  'uploadcompleted' : null,

  // jQuery File Upload options
  'fileupload' : {},

  // translation strings here
  'langmap' : {},

  // A valid callback function that is called during initialization to allow for last second changes to the settings. 
  // Useful for altering fileupload options on the fly. 
  'preinit' : null,

});

Changelog:

2019-02-01

  • Added support for recording directly from a microphone and webcam/camera.

2018-03-03

  • Fixed DOM element creation issue.

2018-02-18

  • Fixed missing URL reference issue.
  • Added server-side helper PHP class.

2018-01-20

  • Added preview dialog show/hide callbacks.

2017-10-10

  • Added server-side helper PHP class.

2017-08-07

  • Improved support for chunked uploads with various bug fixes. Added preinit option.

2017-08-04

  • Fixed pre-upload cancel issue.

This awesome jQuery plugin is developed by cubiclesoft. For more Advanced Usages, please check the demo page or visit the official website.