diff --git a/databox/api/src/Integration/Phrasea/Expose/ExposeClient.php b/databox/api/src/Integration/Phrasea/Expose/ExposeClient.php index f76e4f0b2..eb67ff6ba 100644 --- a/databox/api/src/Integration/Phrasea/Expose/ExposeClient.php +++ b/databox/api/src/Integration/Phrasea/Expose/ExposeClient.php @@ -153,7 +153,7 @@ public function postAsset(IntegrationConfig $config, IntegrationToken $integrati $parts['Parts'] = []; try { - $file = fopen($fetchedFilePath, 'r'); + $fd = fopen($fetchedFilePath, 'r'); $alreadyUploaded = 0; $partNumber = 1; @@ -168,11 +168,11 @@ public function postAsset(IntegrationConfig $config, IntegrationToken $integrati ->toArray() ; - if (($fileSize - $alreadyUploaded) <= 2*$partSize) { + if (($fileSize - $alreadyUploaded) < $partSize) { $partSize = $fileSize - $alreadyUploaded; } - $headerPutPart = $this->putPart($resUploadPart['url'], $file, $partSize, $retryCount); + $headerPutPart = $this->putPart($resUploadPart['url'], $fd, $partSize, $retryCount); $alreadyUploaded += $partSize; @@ -184,7 +184,7 @@ public function postAsset(IntegrationConfig $config, IntegrationToken $integrati $partNumber++; } - fclose($file); + fclose($fd); } catch (\Throwable $e) { $this->create($config, $integrationToken) ->request('DELETE', '/uploads/'. $mUploadId);