1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

fix upload

This commit is contained in:
Damodar Lohani 2021-07-15 17:19:05 +05:45
parent 05674b29a4
commit d3b9765d65

View file

@ -322,8 +322,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
$size = $request->getContentRangeSize();
$fileId = $request->getHeader('x-appwrite-file-id', $fileId);
if(empty($start) || empty($end) || empty($size)) {
if(is_null($start) || is_null($end) || is_null($size)) {
throw new Exception('Invalid content-range header', 400);
}
@ -360,7 +359,7 @@ App::post('/v1/storage/buckets/:bucketId/files')
$file = $dbForInternal->getDocument('files', $fileId);
if (!$file->isEmpty()) {
$chunks = $file->getAttribute('totalChunks', 1);
$chunks = $file->getAttribute('chunksTotal', 1);
if ($chunk == -1) {
$chunk = $chunks - 1;
}