1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

how do i upload more than one image at a time

Discussion in 'PHP' started by adsegzy, Aug 28, 2010.

  1. adsegzy

    adsegzy New Member

    Joined:
    Aug 27, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    please i have this more that i want to use in uploading 5 images at a time, but i don't know how to upload the files into my upload folder;

    PHP:
    <form action="<?php echo $_SESSION['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" name="form1" id="form1">
     <table width="300" border="0" align="center" cellpadding="5" cellspacing="0">
     <tr>
     <td align="center"><label>
     <input type="file" name="file" />
     </label></td>
     </tr>
     <tr>
     <td align="center"><label>
     <input type="file" name="file2" />
     </label></td>
     </tr>
     <tr>
     <td align="center"><label>
     <input type="file" name="file3" />
     </label></td>
     </tr>
     <tr>
     <td align="center"><label>
     <input type="file" name="file4" />
     </label></td>
     </tr>
     <tr>
     <td align="center"><p>
     <label>
     <input type="file" name="file5" />
     </label>
     </p>
     </td>
     </tr>
     </table>
     <p align="center">
     <label>
     <input type="submit" name="Submit" value="Upload" />
     </label>
     </p>
     </form>
    i tried using this move to folder code;

    PHP:
    $file_name = ($_FILES["file"]["name"]);
     
    $random_digit=rand(00000,99999);
     
    $new_file_name=$random_digit $imageResized;

     if ((
    $_FILES["file"]["name"]!="") && file_exists("../upload/" $new_file_name))
     {
     echo 
    "<span class='style3'>Please reupload the Picture.</span>";
     }
     else
     {
     
    move_uploaded_file($_FILES["file"]["tmp_name"],
     
    "../upload/" $new_file_name);
     
    $path2"../upload/" $new_file_name;
    but someone advised i put it in an array but i don't know how to go about that. please ow can i do this or which other less stress way can i do this.

    regards
     
  2. ManzZup

    ManzZup New Member

    Joined:
    May 9, 2009
    Messages:
    278
    Likes Received:
    43
    Trophy Points:
    0
    Occupation:
    Production Manager:Software @ ZONTEK
    Location:
    Sri Lanka
    Home Page:
    i think you'll need to use seperate threads (try googleing)
     
  3. johnny.dacu

    johnny.dacu New Member

    Joined:
    Jul 6, 2010
    Messages:
    88
    Likes Received:
    4
    Trophy Points:
    0

Share This Page