Small Cross-browser jQuery AJAX Upload Plugin - pithyUpload

File Size: 5.26 KB
Views Total: 2543
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Small Cross-browser jQuery AJAX Upload Plugin - pithyUpload

pithyUpload is a lightweight and cross-browser jQuery file upload plugin used to asynchronously upload specified types of files into your web server via AJAX. 

Features:

  • Custom trigger events.
  • Custom data type.
  • Progress bar for upload status.
  • Allows to specify the maximum number of files to upload.
  • Allows to limit the maximum file size.
  • Lots of callback functions.
  • Compatible with legacy IE browsers via iframe

Basic usage:

1. Add JQuery library and the jQuery pithyUpload plugin's script to your html page.

<script src="//code.jquery.com/jquery-1.12.3.min.js"></script>
<script src="jquery.pithyUpload.js"></script>

2. Create a 'multiple' file input on the webapge.

<input type="file" name="pithyUpload" id="pithyUpload" multiple>

3. Call the function on the file input and we're ready to go.

$('#pithyUpload').pithyUpload();

4. Available plugin settings with default values.

$('#pithyUpload').pithyUpload({
  url: document.URL,
  method: 'POST',
  extData: {},//extra data
  maxFileSize: null,
  maxFiles: null,
  allowedTypes: null,//null or array(eg. ['jpg', 'doc'])
  dataType: 'json',//ajax dataType
  fileName: 'pithyUpload',
  trigger: null,//null or 'change'
  //callbacks - if IE, only onNewFile, onComplete
  onNewFile: function () { },
  onComplete: function () { },
  onUploadProgress: function () { },
  onUploadSuccess: function () { },
  onUploadError: function () { },
  onFileTypeError: function () { },
  onFileSizeError: function () { },
  onFilesMaxError: function () { }
});

Change log:

2016-06-02


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