Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix committed Nov 28, 2024
1 parent bed71ac commit 7bde652
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions databox/api/src/Integration/Phrasea/Expose/ExposeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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);
Expand Down

0 comments on commit 7bde652

Please sign in to comment.