mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-26 19:29:58 +03:00
fix *.part data corruption
Fixed a bug where when a file upload failed, re-uploading the file would cause the uploaded data to be damaged.
This commit is contained in:
parent
8f721fcb8b
commit
9c10b3973b
1 changed files with 1 additions and 1 deletions
|
@ -1746,7 +1746,7 @@ function ws_images_upload($params, $service)
|
|||
// file_put_contents('/tmp/plupload.log', "[".date('c')."] ".__FUNCTION__.', '.$fileName.' '.($chunk+1).'/'.$chunks."\n", FILE_APPEND);
|
||||
|
||||
// Open temp file
|
||||
if (!$out = @fopen("{$filePath}.part", $chunks ? "ab" : "wb"))
|
||||
if (!$out = @fopen("{$filePath}.part", $chunks && $chunk != 0 ? "ab" : "wb"))
|
||||
{
|
||||
die('{"jsonrpc" : "2.0", "error" : {"code": 102, "message": "Failed to open output stream."}, "id" : "id"}');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue