fix: adopt potentially changed file extension when downloading
This commit is contained in:
@@ -59,6 +59,12 @@ class BatchDownloadController extends AbstractController
|
||||
/** @var Upload $upload */
|
||||
$filename = $upload->getOriginalFilename();
|
||||
$filepath = $this->uploadHandler->getUploadFilepath($upload);
|
||||
$extension = pathinfo($filepath, PATHINFO_EXTENSION);
|
||||
|
||||
// adopt potentially changed file extension
|
||||
if (false === str_ends_with($filename, $extension)) {
|
||||
$filename = $filename.'.'.$extension;
|
||||
}
|
||||
|
||||
try {
|
||||
$zip->addFileFromPath(fileName: $filename, path: $filepath);
|
||||
@@ -79,4 +85,4 @@ class BatchDownloadController extends AbstractController
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user