I have a form which I am using to upload users photos but the problem is that I can upload 1 photos each time .like facebook I want my users to select multiple images in one shot. can anyone please guide. here is my present code.
<tr><td><input type="file" name="photos[]" /></td><td><input type="text" size="35" name="descriptions[]" /></td></tr>
and php is processing the uploaded images. can you please tell how should I do so that multiple images can be selected and uploaded in one shot
first thing is you need to make your form multipart
And if you use HTML5 the next part is to create a named array
This will put all files into a $_POST array called multiImageUpload.
In order to allow a name to accept multiples in an array you need to use []
at the back of name,
name[] or images[] or files[], also using the HTML5property
multiplemultiple=''ormultiple='multiple'will allow youto select multiple files at once form a single input.
Here’s some working sample code to play around with
The HTML
The PHP