title: Detect if uploaded file is too large
body: <p>This is my upload form:</p>
  
  <pre><code>&lt;form action="uploads.php" method="post" enctype="multipart/form-data"&gt;
      &lt;input name="fileupload" type="file" multiple&gt;
      &lt;button&gt;Upload&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>My max upload sizes are set like this:</p>
  
  <pre><code>; Maximum allowed size for uploaded files.
  upload_max_filesize = 5M
  
  ; Must be greater than or equal to upload_max_filesize
  post_max_size = 5M
  </code></pre>
  
  <p>If I upload a file that is larger then 5M <code>var_dump($_FILES)</code> is empty. I can do that:</p>
  
  <pre><code>if($_FILES){
      echo "Upload done!";
  }
  </code></pre>
  
  <p><code>$_FILES</code> is not set if the file is larger then 5M. But this is a bit strange. How would you do that?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>var_dump of file over 5M:</p>
  
  <pre><code>array(0) {
  }
  </code></pre>
  
  <p>var_dump of file &lt;= 5M:</p>
  
  <pre><code>array(1) {
    ["fileupload"]=&gt;
    array(5) {
      ["name"]=&gt;
      string(13) "netzerk12.pdf"
      ["type"]=&gt;
      string(15) "application/pdf"
      ["tmp_name"]=&gt;
      string(22) "/tmp/uploads/phpWhm8M0"
      ["error"]=&gt;
      int(0)
      ["size"]=&gt;
      int(352361)
    }
  }
  </code></pre>