Are there any solutions to upload multiple files at once without flash? :)
Not like that: choose one file, it goes to the stock, choose second file, it goes to the stock and than upload. But choose at once all needed files and upload them.
Are there any solutions to upload multiple files at once without flash? :)
Not like that: choose one file, it goes to the stock, choose second file, it goes to the stock and than upload. But choose at once all needed files and upload them.
HTML5 supports multiple files, by specifying the "multiple" attribute on the input.
Give the input a name attribute ending in square brackets (i.e. "myfileinput[]") and it will appear to PHP exactly the same as if there were two inputs called the same thing on the page.
This obviously doens't work in legacy browsers, however lack of support for multiple file uploads could be detected via JS, and multiple file inputs created via JS.
You can have multiple file input fields:
or
They can be created dynamically via Javascript, or created in advance from the server. Either way, you get multiple files uploaded, though only file per input field.
The first option will work as expected. You'll get one $_FILES array entry per file in PHP. The other option, with the array notation, works a bit counter-intuitively. You get something that looks like