-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uploaded binary files differ from originals #2
Comments
What kind of binary files did you try to upload? And was the file size matching? More information would be helpful. |
A few issues I see here:
I would imagine combining these 3 should fix the issues encountered by @NewPlayer2 EDIT: |
I will try to replicate the issues as soon as I have some free time. Looks like I will have to test couple of file formats:
|
added condition to delete tmp folder only when file is combined from chunks. |
Issues should be fixed with 0.1.2. |
The problem still persists with partly uploaded ZIP files. If you try to reupload after page refresh, then uploaded file is corrupted and file size doesn't match original file. Solved this by using @georaldc solution: public function createFileFromChunks($chunkFiles, $destFile)
{
$this->log('Beginning of create files from chunks');
natsort($chunkFiles);
if (($fp = fopen($destFile, 'w')) !== false) {
foreach ($chunkFiles as $chunkFile) {
fwrite($fp, file_get_contents($chunkFile));
$this->log('Append ', ['chunk file' => $chunkFile]);
}
fclose($fp);
}
$this->log('End of create files from chunks');
return true;
} Also dropped out unlink(...), because we have $tmpFolder->delete(); which deletes whole folder and everything inside it. |
Installed with composer and used the upload.php code from under "How to use".
Large finished files under the uploads directory DO NOT match the originals. This makes the whole script useless.
The text was updated successfully, but these errors were encountered: