title: Efficient method for large file uploads ( 0 - 5GB ) through php
body: <p>I have been searching for a good method, and banging my head against the wall.</p>
  <p>In a file sharing service project, I have been assigned to determine the best method available for upload large files.</p>
  <p>After searching a lot of questions here on stackoverflow and other forums, here's what I got :</p>
  <ol>
  <li><p><strong>Increase the script maximum execution time, along with maximum file size allowed</strong></p>
  <p>This case really doesn't fit good. It will almost timeout everytime when the file is being uploaded through a normal broadband connection (1mbps-2mbps). Even if PHP scripts are executed after the upload has been done, there is still no guarantee that the upload will not timeout.</p>
  </li>
  <li><p><strong>Chunked upload.</strong></p>
  <p>Although I kind of understand what I'm supposed to do here, but what I'm confused about is that, say a 1GB file is being uploaded, and I'm reading it in chunks of 2MB, still if the upload is slow, the php script execution will timeout and give error.</p>
  </li>
  <li><p><strong>Use other languages like Java and Perl?</strong></p>
  <p>Is it really efficient to use java or perl for handling file uploads?</p>
  </li>
  </ol>
  <p>Method used by the client is not the problem here, as we'll be issuing a client SDK, and can implement the method of our choice in it. Both the client and server end implementations will be decided by us.</p>
  <p>What method, according to you, should be the best one, considering that the memory usage should be efficient, and there may be many concurrent uploads going on?</p>
  <p>How do Dropbox, and similar cloud storage services handle big file uploads, and still stay fast at it?</p>