views:

73

answers:

6

Hi there,

how do I create a file input which allows multiple files to be selected and uploaded? It seems that <input type="file" name="fileinput"> allows only 1 file to be selected at a time, while the input on http://filetolink.com/ (for example) let's the user select multiple files. How is this done and how do I go about processing?

Thanks in advance!

A: 

It is done using Flash which assumes that the client browser has Flash installed and enabled. The standard HTML <input type="file"> allows only a single file. You may find the SWFUpload flash component useful.

Darin Dimitrov
Thank you for your quick response!
Chris
+2  A: 

The HTML 5 input element can do this, but it's not widely supported yet. (See here, the second answer)

Flash based uploaders like SWFUpload and Uploadify have this, but as said they need Flash, and they have a different philosophy behind how they work.

Pekka
Ah well it's for personal use and the only browsers I have installed are Firefox and Chrome, so the HTML5 could come in handy.
Chris
yeah, in code for layy ppl: `<input type="file" name="uploads" multiple />`
Question: Why got this answer +2? If we look @ the "tags" and the question, we might see that the user wants to have a html/php, a clean, solution. Flash is 3rd party software which is mostly available but not the perfect answer for this problem. You should up vote answers promoting HTML+JS, and I do not mean experimental HTML, HTML5 isn't standard yet.
daemonfire300
@daemonfire if I understand the OP correctly, he wants people to be able to select *multiple files at once*, which is something no pure HTML+JS solution can do yet.
Pekka
+2  A: 

Hi Chris, there are plenty of javascript extensions to achieve the task you asked. Try to check it with jQuery repository.

One example you may find here: http://www.fyneworks.com/jquery/multiple-file-upload/

Igor
Thank you for your helpful links, I'll have a look! (Don't know much about JS though :-( )
Chris
A: 

Possible by using Javascript and HTML4, you may use this jQuery Plugin (http://www.fyneworks.com/jquery/multiple-file-upload/).

daemonfire300
+1  A: 

Checkout the JQuery Uploadify component component, works consistently across browsers. Here is a demo.

Vinay B R
A: 

Multiple file uploader using mootool: http://the-stickman.com/files/mootools/multiupload/

SwfUpload: It uses flash If you want to get an idea how to process the uploaded file checkout this link sample php code

Another one is fancyupload (uses flash and mootools)

Uploading using an HTML5 compliant browser (Firefox 3.6, Chrome 3.0 or Safari 4) This is a new method of uploading files is not widely supported by all browsers. See an example using php at link

http://www.uploadify.com/ is also another great multiple file uploader. The user can upload all the files at once using ctrl + clicking on all of the files

Meryl