jQuery Multiple File Upload Pluginv1.29 |
|
The Multiple File Upload Plugin (jQuery.MultiFile) is a non-obstrusive plugin for the jQuery Javascript library that helps users easily select multiple files for upload quickly and easily whilst also providing some basic validation functionality to help developers idenfity simple errors, without having to submit the form (ie.: upload files).
Just add the multi
class to your file input element.
|
» |
Use the maxlength
property if you want to limit the number of files selected
|
» |
Use the accept
property if you only want files of a certain extension to be selected
(separate valid extensions with a "|").
|
» |
PS.: Sever-side validation is always required.
$(function(){ // wait for document to load
$('#MyFileUpload').MultiFile();
});
$(function(){ // wait for document to load
$('#MyFileUpload').MultiFile(5 /*limit will be set to 5*/);
});
$(function(){ // wait for document to load
$('#MyCoolFileUpload').MultiFile({
max: 5,
accept: 'gif,jpg,png,bmp,swf'
});
});
$(function(){ // wait for document to load
$.MultiFile({
afterFileSelect:function(element,value,master){
alert('File selected:\n'+value);
}
});
});
$(function(){ // wait for document to load
$('#PortugueseFileUpload').MultiFile({
STRING: {
remove:'Remover',
selected:'Selecionado: $file',
denied:'Invalido arquivo de tipo $ext!'
}
});
});
The plugin doesn't have any additional languages built-in, but it's very easy to customise the messages to any language of your choosing. See the examples below...
NB.: This example has been configured to accept gif/pg files only in order to demonstrate the error messages.
<input type="file" class="multi
{accept:'gif|jpg', max:3, STRING:{
remove:'Remover',
selected:'Selecionado: $file',
denied:'Invalido arquivo de tipo $ext!',
duplicate:'Arquivo ja selecionado:\n$file!'
}}" />
<input type="file" id="PortugueseFileUpload" />
$(function(){
$('#PortugueseFileUpload').MultiFile({
accept:'gif|jpg', max:3, STRING: {
remove:'Remover',
selected:'Selecionado: $file',
denied:'Invalido arquivo de tipo $ext!',
duplicate:'Arquivo ja selecionado:\n$file!'
}
});
});
<input type="file" class="multi-pt" />
<input type="file" class="multi-pt" />
<input type="file" class="multi-pt" />
$(function(){
$('.multi-pt').MultiFile({
accept:'gif|jpg', max:3, STRING: {
remove:'Remover',
selected:'Selecionado: $file',
denied:'Invalido arquivo de tipo $ext!',
duplicate:'Arquivo ja selecionado:\n$file!'
}
});
});
No, this jQuery plugin does not upload files
Javascript is a client side language and cannot upload files - this plugin will only go as far as helping the user select the files to upload and assisting in the validation process by warning the user of common mistakes before server-side validation takes place. When the form is submitted, it's up to you to have a server-side script that will actually upload the files.
Please do not email me asking how to do this!!! There is plenty of information out there and you can easily find it on Google. But because I'm such a nice guy, I've put a quick list of the best links here:
FreeASPUpload - Free, easy to use and no component required. This is my favourite.
See File Upload Tutorials from W3CSchools, About.com, Tizag
NOTICE TO PHP USERS:
The plugin's default behaviour generates an array of elements (sharing the same name).
In order for this array to be properly identified and handled in PHP, you have add "[]" to name of your element.
eg.:
<input type="file" name="MyStuff[]"...
Package: |
![]() previous versions 1.00, 1.10, 1.20, 1.23, 1.24, 1.25, 1.26, 1.27, 1.28 |
Files: |
These are the individual required files (already included in the zip package above)
|
jQuery: | jquery-latest.js (see jQuery.com) |
Related: |
Metadata plugin - Used to retrieve inline configuration from class variable
blockUI plugin - Used to show pretty error messages Form plugin - Used to submit forms via ajax |
<script src="jquery-latest.js" type="text/javascript" language="javascript"></script>
<script src="jquery.MultiFile.js" type="text/javascript" language="javascript"></script>
Metadata Plugin
This great plugin can be used to configure the plugin via the class parameter.
You can also download the version being used on this page
BlockUI Plugin
Used to show 'pretty' error messages, instead of the browser's alert() function.
You can also download the version being used on this page
Form Plugin
Used to submit forms via Ajax.
Quick Support Links: Help me! | Report a bug | Suggest new feature
Support for this plugin is available through the jQuery Mailing List.
This is a very active list to which many jQuery developers and users subscribe.
Access to the jQuery Mailing List is also available through the
Nabble Forums, the
jQuery Google Group and the
official project page.
Attribution link: | (c) Fyneworks.com |
HTML Code: |
Multiple File Upload Plugin by Fyneworks.com is licensed under the MIT License and the GPL License. | ![]() |
Copyright (c) 2008 Fyneworks.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Multiple File Upload Plugin
by Fyneworks.com
is licensed under the MIT License and the GPL License. |
[back to top]
![]() |