Simple HTML5 file uploader created as a plugin for jQuery.
You can apply jquery.uploader plugin to the input file and change its settings. Example:
$(':input[type="file"]').uploader({
'showThumbs': true,
'addMore': true,
'allowDuplicates': false
});
Name | Description |
---|---|
limit |
Maximal number of files. Number; Default value: null |
maxSize |
Maximal file size in MB's. Number; Default value: null |
extensions |
File extension's whitelist. Array; Default value: null |
changeInput |
Create a new file input element. You can use the default template or to write your own as string or jquery element. Boolean, String, Object; Default value: true |
showThumbs |
Show the in-browser files previews. Boolean; Default value: false |
appendTo |
The target thumbnails target element selector. Use this option when you want to append your files previews into specific element. String; Default value: null |
theme |
Specify the jquery.uploader theme. It will just set to main filer div as class the theme name. String; Default value: 'default' |
templates |
Specify the templates, selectors and some options. Object
|
uploadFile |
Enable instant file uploading feature. Object; Default value: null
|
dragDrop |
Enable Drag&Drop feature. In this object you can specify only the callbacks. Note that this feature wors only with instant upload. Object; Default value: null
|
addMore |
Multiple file selection without instantly uploading them. You need to enable this feature in edit mode when you need to upload more than 1 file. Boolean; Default value: false |
excludeName |
By removing a file the script is creating an hidden input with it's name. Use this option if you want to specify the input's name. String; Default value: null |
files |
The list with the already uploaded files. Use this option in edit mode. Array; Default value: null
|
beforeRender |
A function that is fired before rendering the new file input. Function; Default value: null |
afterRender |
A function that is fired after rendering the new file input. Function; Default value: null |
beforeShow |
A function that is fired before showing thumbnail's box. Should return boolean value. Function; Default value: null |
afterShow |
A function that is fired after appending all thumbnails items. Function; Default value: null |
beforeSelect |
A function that is fired after selecting a file and before adding it to the memory. Should return boolean value. Function; Default value: null |
onSelect |
A function that is fired after selecting a file. Function; Default value: null |
onRemove |
A function that is fired after deleting a file. Function; Default value: null |
onEmpty |
A function that is fired when no files are selected. Function; Default value: null |
options |
Specify your own options that you can also use as uploader variables. Object; Default value: null |
captions |
Specify your own captions. Here you can also use uploader variables. Object
|
icons |
Specify icons to be used Object
|
The plugin comes with a number of public values and functions to help you utilize the plugin in a number of different scenarios. To use it you will need to get the input property. Example:
var uploader = $(':input[type="file"]').prop('uploader');
uploader.reset();
Name | Description |
---|---|
options |
jquery.uploader options Object |
boxEl |
Thumbnail's box element. DOM Object |
listEl |
Thumbnail's list element. DOM Object |
newInputEl |
New file input element. DOM Object |
inputEl |
File input element. DOM Object |
files |
Javascript FileList files. FileList |
files_list |
jquery.uploader files list Object |
current_file |
Last choosed file. Object |
append(file) |
Append file function. Send an object with file information as paramenter. Function
|
retry(index) |
Retry upload-failed file function. Send file index as paramenter. Function |
remove(index) |
Remove file function. Send file index as paramenter. Function |
reset() |
Reset function. Function |