title: How to send PHP variable to PHP server as a $_FILE
body: <p>We have PHP code on a server that receives files into $_FILE and then stores them based on user/security considerations. </p>
  
  <p>We have client code that processes some data and generates a file into a variable $fileToSend- as one example, think of the output from a file that the client has read and encrypted, or as another example think of the results from generating file to a variable using FDPF's <a href="http://www.fpdf.org/en/doc/output.htm" rel="nofollow"><code>Output("", "S")</code></a> which returns the resulting PDF file as a string.  The $fileToSend could be pretty large (500MB).</p>
  
  <p>We could save the variable as a file and then send the file as a <code>curlFile</code> using <code>curl</code>, but that just seems wasteful of time, space and effort.  </p>
  
  <p>How can we POST from a variable on the PHP client side and have it appear in $_FILE on the server side?</p>