Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post

    $_FILES is empty!

    can't upload files.. can someone help pls?

    Code:
    <?php
    
    if (isset($_POST['createUserGroup_x'])) {
    
      echo 'this output displays when the form is submitted';
    
      var_dump($_FILES); // this is empty -- why?  I uploaded a file which was only 12 kb!
    
      if(isset($_FILES['uploadedfile']['name'])){ 
    
        echo 'nothing in here outputs because $_FILES is empty';
    
      }
    
      echo 'the remainder of my form outputs down here';
    
    }
    // what am I doing wrong?
    ?>
    
    
    <form action="" method="post" id="commentform" name="commentform">
      
      <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
    
      <input type="file" name="uploadedfile" size="30" />
    
      <input id="createUserGroup" name="createUserGroup" type="image" src="/img/icons/icon_submit.gif" />
    
    </form>

  • #2
    Regular Coder
    Join Date
    Dec 2006
    Posts
    417
    Thanks
    168
    Thanked 1 Time in 1 Post
    gah! I am so stupid!!!!

    enctype="multipart/form-data"

    how could I forget this???

    sleep helps...

  • #3
    New Coder
    Join Date
    Mar 2008
    Location
    Lakeland, FL
    Posts
    39
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Everyone makes mistakes :P Just most of the time we catch them before we post questions on them :P


  •  

    Posting Permissions

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