Skip to content

Commit

Permalink
[BUGFIX] Fix regression from PR: Get filesize and filetype also when …
Browse files Browse the repository at this point in the history
…confirmation page is active

Reverts parts from #739
  • Loading branch information
einpraegsam committed Jun 16, 2022
1 parent 95b9b2c commit 06126ed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Classes/Domain/Factory/FileFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ public function getInstanceFromExistingAnswerValue(string $fileName, Answer $ans
}

/**
* This subfunction is used to create a file instance. E.g. when a file was just uploaded or when a confirmation
* page is active, when a file was already uploaded in the step before.
*
* @param string $marker
* @param string $originalName
* @param int $size
Expand Down Expand Up @@ -132,9 +135,9 @@ protected function makeFileInstance(
$file->setNewName(StringUtility::cleanString($originalName));
$file->setUploadFolder($this->getUploadFolder());
if ($size === 0) {
$size = filesize($file->getTemporaryName());
$size = (int)filesize($file->getNewPathAndFilename(true));
}
$file->setSize((int)$size);
$file->setSize($size);
if ($type === '') {
$type = (new FileInfo($file->getTemporaryName()))->getMimeType() ?: 'application/octet-stream';
}
Expand Down

0 comments on commit 06126ed

Please sign in to comment.