23/resumable.js — pull request #44 by 2xyo (2013-02-17 15:52:23+00:00)
Title: Some fixes for the PHP backend

The PHP backend never create the final file.

Example with a file of 7837873 bytes :
* chunk 1
* chunk size : 1048576 (from `$_POST['resumableChunkSize']`)
* HTTP Content-Length : 1049640
* chunk 2-6.. The same
* chunk 7
* Last chunk !
* chunk size : 1048576 (from `$_POST['resumableChunkSize']`) < Wrong !
* HTTP Content-Length : 1547481
* `if ($total_files * $chunkSize >= $totalSize)`
* `$total_files * $chunkSize` : 7340032
* `$totalSize` :7837873

We have : `chunkSize < lastChunkSize < 2*chunkSize`
So the fix is just : ` $total_files * $chunkSize >= $totalSize - $chunkSize + 1.`

I have also deleted all `@` because it's the evil.

My 2 cents