How to upload multiple images in one time through PHP ?

Description:- Through this example you can easily come to know how to upload multiple images in one time by selecting the images through ctrl button.

<!-- Uploading multifiles by webtechball -->
<!-- -->
<!DOCTYPE html>
<title>Multifile uploading by Webtechball</title>
img{margin:10px 0 0 10px; border:1px inset rgba(51,51,51,1);}
<form action="<?php $_PHP_SELF; ?>" method="post" enctype="multipart/form-data">
    <input type="file" name="multiImgs[]" multiple/> 
    <input type="submit" name="upload" value="Upload"/>

    //Inserting the name of the files into the loop, so that it will upload each and every file
    for($a=0; $a < count($_FILES['multiImgs']['name']); $a++)
        echo "<img src='upload/".$_FILES['multiImgs']['name'][$a]."' width=100px height=100px/>"
        //Printing each and every files with loop


*Note :- Copy the code and paste in your text editor and save it in your htdocs and
don’t forget to create a new folder and rename it as “upload”. This will be your folder where your uploaded files will going to be save.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s