title: Max_File_Uploads directive php.ini
body: <p>Im trying to do a simple file upload.  I've done it many times before and it's been fine.  For some reason this time I keep getting error <code>UPLOAD_ERR_INI_SIZE</code> coming up.  Even though i've uploaded bigger files on the same server before.  Here is my PHP.INI:</p>
  
  <pre><code>display_errors = On
  short_open_tag = On
  memory_limit = 32M
  date.timezone = Europe/Paris
  upload_max_filesize = 10M
  post_max_size = 10M
  </code></pre>
  
  <p>And my HTML form:</p>
  
  <pre><code>&lt;form action="/settings/upload-image" method="POST" enctype="multipart/form-data"&gt;
      &lt;input type="hidden" name="MAX_FILE_SIZE" value="&lt;?=(1024*1024*1024);?&gt;"&gt;
      &lt;input name="files[]" id="attachfile" type="file" /&gt;
      &lt;br /&gt;&lt;br /&gt;
      &lt;input type="submit" class="submit" value="Upload New Profile Image"&gt;       
  &lt;/form&gt;
  </code></pre>
  
  <p>And my code:</p>
  
  <pre><code>foreach($files as $file)
                  {   $ext = strtolower(pathinfo($file[0], PATHINFO_EXTENSION));
                      if(in_array($ext,$allowed_upload_ext)===TRUE)
                      {       
                              if(!$file[3]) {     // If no error code
                                  //$newFile = $me['id'].".$ext";
                                  $newFile = $file[0];
                                  resizeImage($file[2],PROFILE_IMAGES."/".$newFile,$ext,500);
                                  genThumbFile($file[2],PROFILE_IMAGES."/thumb/".$newFile);
  
                                  runSQL("UPDATE `users` SET `image`='{$file[0]}' WHERE `id`='{$me['id']}';");
                                  array_push($msgs,"Image uploaded successfully.");
                                  $me = select("SELECT * FROM `users` WHERE `id`='{$me['id']}';",true);
                              } else {
                                  array_push($msgs,"!".fileError($file[3]));
                              }
                      } else {
                          array_push($msgs,"!The file ".$file[0]." could not be uploaded as it is the wrong file type."); 
                      }
                  }
  </code></pre>
  
  <p>The only difference this time is that I am resizing and genorating thumbs with the <em>temporary upload file</em> instead of copying over the file first.  Could that be the problem?  I dont think so, because if the image is small it works perfectly fine.  But I try anything like 2mb and it throws a fit.</p>
  
  <p>Suggestions?</p>