title: PHP Drag & Drop File Upload with ExtJS
body: <p>I have a widget I'm using that does a request to a method I created in a Zend controller. The user uploads an image to the server and the jpeg is POST'd to the server within the request body. </p>
  
  <p>How do you access this on the PHP side? I've looked in $_POST, $HTTP_RAW_POST_DATA (after setting the php.ini setting), $_FILES, and tried:</p>
  
  <pre><code>$data = file_get_contents( 'php://input' );
  </code></pre>
  
  <p>All of those globals and variables are empty. I'm using charles proxy and you can see the request and the image binary data in it. I'll link a screenshot as soon as I can (imgur is down).</p>
  
  <p><img src="https://i.stack.imgur.com/P9aiP.png" alt="enter image description here"></p>
  
  <p>Edit: Screenshot </p>
  
  <p>Edit: I'm getting somewhere:</p>
  
  <pre><code>public function filesAction() {
  
          $request = $this-&gt;getRequest();
          $params  = $request-&gt;getParams();
  
          if ( $request-&gt;isPost() ) {
  
                      $httpContent = fopen( 'php://input', 'r' );
                      echo stream_get_contents( $httpContent );
  
          }
  }
  </code></pre>
  
  <p>This is returning the binary data back to me in the response now, I just need to use fwrite() or something similar to create the image on the server and then I can move on to FTP'ing it where it needs to go.</p>