title: Limit on POST request, 65KB image max
body: <p><strong>Situation</strong></p>
  
  <p>I'm trying to load an image into a php script through POST request.</p>
  
  <p><strong>Problem</strong></p>
  
  <p>The post action only works when the image is smaller than a size between 65.151 and 65.686 bytes. (I haven't figured out what the exact limit of bytes is that it will accept, i only know that 65.151 bytes works but 65.686 bytes and all above doesn't.)</p>
  
  <p><strong>Symptoms</strong></p>
  
  <p>When i try to upload an image that exceeds the limit that i described above, the webpage would hang. When i monitor the network in the browser it shows the POST request with a (pending) status. The body of the request contains the form with the image field. The reponse header is missing.</p>
  
  <p>When i upload an image that doesn't exceed the limit, it shows the correct status and a response header and prints out the array containing the image with the correct size, ect..</p>
  
  <p>There are no errors reported by php.</p>
  
  <p><strong>Environment</strong></p>
  
  <p>I'm running everything localy on my windows 7 laptop.
  I have a windows php 5.6.8 engine which i installed seperatly.
  I'm using Phpstorm to develop and run the application (it uses the php engine desribed above).
  I'm using chrome and IE to test and troubleshoot.</p>
  
  <p><strong>Settings</strong></p>
  
  <p>I have fiddled alot with the following settings in php.ini:</p>
  
  <ul>
  <li><p>post_max_size</p></li>
  <li><p>upload_max_filesize</p></li>
  <li><p>memory_limit</p></li>
  </ul>
  
  <p>current settings:</p>
  
  <ul>
  <li><p>post_max_size = "2048M"</p></li>
  <li><p>upload_max_filesize = "2048M"</p></li>
  <li><p>memory_limit = 128M</p></li>
  </ul>
  
  <p><strong>Code</strong></p>
  
  <p>I've tried many differend approaches but currently i'm using the following code:</p>
  
  <p>test-file-upload.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head lang="en"&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form action="uploadImage.php" method="post" enctype="multipart/form-data"&gt;
      Select image to upload:
      &lt;input type="file" name="fileToUpload" id="fileToUpload"&gt;
      &lt;input type="submit" value="Upload Image" name="submit"&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>uploadImage.php</p>
  
  <pre><code>&lt;?php
  print_r($_FILES);
  ?&gt;
  </code></pre>
  
  <p><strong>Directory structure</strong></p>
  
  <ul>
  <li><p>controller (dir)</p>
  
  <p>-> test-file-upload.html (file)</p>
  
  <p>-> uploadImage.php (file)</p></li>
  </ul>
  
  <p>Could anybody give me an explanation why this is happening?</p>