title: is_uploaded_file array given error
body: <p>i have this error in my upload file. The syntax is correct, where is the problem? </p>
  
  <p>The error:</p>
  
  <blockquote>
    <p>is_uploaded_file() expects parameter 1 to be string, array given in C:\Program Files\EasyPHP-5.3.5.0\www\bena_website\admin\variables\upload_img.php on line 34</p>
  </blockquote>
  
  <pre><code>&lt;h3&gt;Please Choose a File and click Submit&lt;/h3&gt;
  
          &lt;form enctype="multipart/form-data" action="&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;" method="post"&gt;
              &lt;input type="hidden" name="MAX_FILE_SIZE" value="10000000" /&gt;
              &lt;input name="userfile[]" type="file" /&gt;
              &lt;input type="submit" value="Submit" /&gt;
          &lt;/form&gt;
  
  &lt;?php
          // check if a file was submitted
          if(!isset($_FILES['userfile'])) {
              echo '&lt;p&gt;Please select a file&lt;/p&gt;';
          }
          else
              {
              print_r( $_FILES );
              try {
                  upload();
                  // give praise and thanks to the php gods
                  echo '&lt;p&gt;Thank you for submitting&lt;/p&gt;';
              }
              catch(Exception $e) {
                  echo $e-&gt;getMessage();
                  echo 'Sorry, could not upload file';
              }
          }
  // the upload function
  function upload(){
  
  if(is_uploaded_file($_FILES['userfile']['tmp_name'])) {
  
      // check the file is less than the maximum file size
      if($_FILES['userfile']['size'] &lt; $maxsize)
          {
      // prepare the image for insertion
      $imgData =addslashes (file_get_contents($_FILES['userfile']['tmp_name']));
      // $imgData = addslashes($_FILES['userfile']);
  
      // get the image info..
        $size = getimagesize($_FILES['userfile']['tmp_name']);
  
      // put the image in the db...
        // database connection
        mysql_connect("localhost", "root", "") OR DIE (mysql_error());
  
        // select the db
        mysql_select_db ("bena") OR DIE ("Unable to select db".mysql_error());
  
      // our sql query
      $sql = "INSERT INTO testblob
              ( image_id , image_type ,image, image_size, image_name)
              VALUES
              ('', '{$size['mime']}', '{$imgData}', '{$size[3]}', '{$_FILES['userfile']['name']}')";
  
      // insert the image
      if(!mysql_query($sql)) {
          echo 'Unable to upload file';
          }
      }
  }
  else {
       // if the file is not less than the maximum allowed, print an error
       echo
        '&lt;div&gt;File exceeds the Maximum File limit&lt;/div&gt;
        &lt;div&gt;Maximum File limit is '.$maxsize.'&lt;/div&gt;
        &lt;div&gt;File '.$_FILES['userfile']['name'].' is '.$_FILES['userfile']['size'].' bytes&lt;/div&gt;
        &lt;hr /&gt;';
       }
  }
  ?&gt;
  </code></pre>