Skip to content

Commit 06126ed

Browse files
committed
[BUGFIX] Fix regression from PR: Get filesize and filetype also when confirmation page is active
Reverts parts from #739
1 parent 95b9b2c commit 06126ed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Classes/Domain/Factory/FileFactory.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ public function getInstanceFromExistingAnswerValue(string $fileName, Answer $ans
104104
}
105105

106106
/**
107+
* This subfunction is used to create a file instance. E.g. when a file was just uploaded or when a confirmation
108+
* page is active, when a file was already uploaded in the step before.
109+
*
107110
* @param string $marker
108111
* @param string $originalName
109112
* @param int $size
@@ -132,9 +135,9 @@ protected function makeFileInstance(
132135
$file->setNewName(StringUtility::cleanString($originalName));
133136
$file->setUploadFolder($this->getUploadFolder());
134137
if ($size === 0) {
135-
$size = filesize($file->getTemporaryName());
138+
$size = (int)filesize($file->getNewPathAndFilename(true));
136139
}
137-
$file->setSize((int)$size);
140+
$file->setSize($size);
138141
if ($type === '') {
139142
$type = (new FileInfo($file->getTemporaryName()))->getMimeType() ?: 'application/octet-stream';
140143
}

0 commit comments

Comments
 (0)