SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2011
    0 Post(s)
    0 Thread(s)

    Unable to upload multiple files using POST

    Hi all...i have a problem in uploading multiple files

    my file uploading page has a form with code

    PHP Code:
    <?php    for($i=0;$i<num;$i++)      //<-------------------------------------------num determined at runtime
    'Upload file :';    ?>
               <input name="userfile[]" type="file"  />
    <?php }  ?>

    I submit it and for handling this i used:
    I have a folder 'uploads'

    PHP Code:
    foreach (
    $_FILES["userfile"]["name"] as $key => $name) {
    $tmp_name $_FILES["userfile"]["tmp_name"][$key];
    $name $_FILES["userfile"]["name"][$key];

    but i get the error message

    Warning: move_uploaded_file(/uploads/5.l) [function.move-uploaded-file]: failed to open stream: No such file or directory in /home/harsh/public_html/testroom/fileContainer.php on line 7

    Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpfGSibR' to '/uploads/5.l' in /home/harsh/public_html/testroom/fileContainer.php on line 7

    please help me out of it..I am not sure if the file handling code is correct because i copied and modified a code from
    Last edited by SpacePhoenix; Sep 20, 2011 at 23:06. Reason: placed php tags around the php code

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Poole, UK
    103 Post(s)
    0 Thread(s)
    Have you set the file permissions of the destination folder to allow writing?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts