Skip to content

Commit

Permalink
Improve logging and remove an else
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Dec 3, 2023
1 parent c09ba02 commit 4d5bf5d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Resumable.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ public function handleChunk()

if ($this->isFileUploadComplete($filename, $identifier, $chunkSize, $totalSize)) {
$this->isUploadComplete = true;
$this->createFileAndDeleteTmp($identifier, $filename);
$this->log('Upload of ' . $identifier . ' is complete');
$this->createFileAndDeleteTmp($identifier, $filename);
}

return $this->response->withStatus(201);
Expand All @@ -319,11 +319,12 @@ private function createFileAndDeleteTmp(string $identifier, ?string $filename):
$chunkFiles = $this->fileSystem->listKeys(
$chunkDir
)['keys'];

$finalFilename = $filename;

// if the user has set a custom filename
if (null !== $this->filename) {
$finalFilename = $this->createSafeFilename($this->filename, $filename);
} else {
$finalFilename = $filename;
}

// replace filename reference by the final file
Expand Down

0 comments on commit 4d5bf5d

Please sign in to comment.