title: PHP - **manually** creating the $_FILES superglobal array
body: <p>This is in reference to this question - <a href="https://stackoverflow.com/questions/13913661/need-something-that-is-same-as-files-from-remote-server-download-with-php">need something that is same as $_FILES from remote server download with php</a></p>
  
  <p>In the above post, what the OP basically wants is to <strong>manually</strong> populate the <code>$_FILES</code> superglobal array for file uploads.</p>
  
  <p>In the answer, you will see the use of <code>tempnam</code> to create a temporary file and storing the resource in it by using <code>file_get_contents</code>, which i think should work in theory (not tested).</p>
  
  <p>Now, my question is doesn't PHP has any checks in order to detect and prevent this behavior or how does <code>post-max-size</code> / <code>upload-max-filesize</code> <code>ini</code> values affect this manually created <code>$_FILES</code> array?</p>