THIS IS AN OLD POST
Please go to the jQuery Multiple File Upload Plugin Project Page
I believe the really long name says it all...
Official jQuery project page: http://jquery.com/plugins/project/MultiFile
Documentation, download and demos: Multiple File Upload Plugin for jQuery
I wrote this plug-in (aka. jQuery.MultiFile) is to help users easily select multiple files for upload in a concise quick and easy manner.
16 comments:
can you limit the extention of the files??
hi Dejitaru,
I've been looking into this...
I think you can use accept="image/gif,image/jpeg" but I'm not sure which browsers do/don't support this property so you'll have to do some testing.
But if you can't control the common dialogue displayed by the browser, then you can't stop the user from selecting an invalid extension.
What you can do is warn them about the error and reject the selection by clearing the value of the file input element. I will definitely include this feature on the next update (probably this weekend).
Thanks,
Diego A.
Love the plugins. How do you make it work with PHP ? Can you point a php upload class or script that would work well with your plugin ?
Thank you
This is a JavaScript plugin for a client interface, it does not deal with the actual uploading of the file. It just makes selecting multiple files for upload easier and neater.
I'm not a PHP programmer so I can't comment on PHP upload classes but try these:
1.
PHP: Handling file uploads - Manual
If no file is selected for upload in your form, PHP will return ... In case your php upload code won't do as expected, open up the php.ini file and set the ...
2.
Free PHP scripts and classes: Easy PHP Upload
Easy to use upload functions for (multiple) file upload with validation.
3.
PHP File Upload - PHP Upload Script - Upload file script
Upload a file from your browser to your server using PHP.
Or search on Google for "PHP upload"
You can't upload a file with this. It puts the file name but not the path.
Hi Mitch,
The plugin is a client interface and ddoes not deal with the uploading of files, if that's what you mean.
If you mean the list only shows the name of the files, that's only what's being displayed and you are mistaken.
For every file that is selected, the plugin creates a standard file input element with the entire path to the selected file, just as it should.
Hi Diego,
I've been using your plugin, and I think I've found a couple of bugs when using with IE6.
1) When you don't specify file extensions, in other words accept any file type, the alert box pops up anyway, saying "You cannot accept a xxx file, try again." Then it goes ahead and loads the path into the file input element.
2) If you do specify a file extension, for example jpg, and then you try to enter a disallowed file type, for example a tiff, it pops up the alert as it should, but then populates the file input anyway, so it's not stopping the user from uploading that file type.
Everything works as expected in FireFox.
Thanks for the plugin!
-- Josh
Hi Josh,
Thanks for the feedback.
1) When you don't specify file extensions...
Thank you! Found the bug and it's now fixed, please download the latest version.
2) Submitting disallowed extensions...
For some reason, neither of these work in IE:
e.attr('value', '');
e.get(0).value = '';
I've started a discussion here...
http://groups.google.com/group/jquery-en/browse_frm/thread/17104b3434456c25
and hopefully somebody will know how to fix this!
Cheers,
Diego A.
I was trying to install the packed edition of the latest version, and the new input elements seem to be lacking name attributes. Therefore I could upload only the first file. The commented edition works fine.
Btw, thank you for your effort.
Hi Igor,
They definitely have name attributes (as far as I can see).
a) Are you sure you got the latest version of the script?
http://www.fyneworks.com/jquery/multiple-file-upload/
b) If so, what browser/system are you using?
Thanks for the feedback,
Diego
Hi!
I just loved your script, but how do i upload de file to a location? i don't see anywhere a path or something like that.
Thank you!
This plugin is a javascript client-side script and does not deal with the actual upload of files. for this you will need a server-side script:
1. PHP: Handling file uploads - Manual If no file is selected for upload in your form, PHP will return ... In case your php upload code won't do as expected, open up the php.ini file and set the ... 2. Free PHP scripts and classes: Easy PHP Upload Easy to use upload functions for (multiple) file upload with validation. 3. PHP File Upload - PHP Upload Script - Upload file script Upload a file from your browser to your server using PHP.
is it capable of selecting multiple files from the select files dialog..
No. The browsers control the file selection dialog and do not allow multiple files to be selected at once.
Hi,
can you please tell me that how to fetch the names of the files which has been selected for upload.
I am unable to get the names as my $_FILES variable is coming blank.
i am using the following code:
including js files "jquery-1.2.6.js" and "jquery.MultiFile.pack.js" through script tag.
input type="file" name="programimage" id="programimage" class="multi" maxlength="5"
input type="submit" name="submit" value="Submit"
I am trying to print the submitted variables like this:
print_r($_GET);
print_r($_FILES);
but Nothing is shown.
But the URL is coming like following:
http://localhost/test/upload/test_upload.php?programimage=Winter.jpg&programimage=&submit=Submit#
I have been puzzled that how to get the names of the files to upload. Please help me.
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.
Post a Comment