From 2b780acc9cd5c7f1ad8dc84c95c941512facfab8 Mon Sep 17 00:00:00 2001 From: Kevin von Spiczak <kevin.spiczak@sgalinski.de> Date: Wed, 12 Feb 2025 16:07:38 +0100 Subject: [PATCH] [BUGFIX] automatically create JobApplication & JobApplication/temp directories --- Classes/Controller/JoblistController.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Classes/Controller/JoblistController.php b/Classes/Controller/JoblistController.php index 6c0025a0..3d14a941 100644 --- a/Classes/Controller/JoblistController.php +++ b/Classes/Controller/JoblistController.php @@ -189,6 +189,25 @@ class JoblistController extends ActionController { } } + /** + * Make sure the upload folder & upload temp folder exists + * + * @return void + * @throws ExistingTargetFolderException + * @throws InsufficientFolderAccessPermissionsException + * @throws InsufficientFolderWritePermissionsException + */ + public function initializeAction(): void { + $storage = $this->fileAndFolderService->getStorage(); + if (!$storage->hasFolder($this->jobFolderPath)) { + $storage->createFolder($this->jobFolderPath); + } + $tempFolderPath = $this->jobFolderPath . DIRECTORY_SEPARATOR . UploadController::JOB_APPLICATION_TEMP_FOLDER; + if (!$storage->hasFolder($tempFolderPath)) { + $storage->createFolder($tempFolderPath); + } + } + /** * Initialize the indexAction to set the currentPageBrowserPage parameter */ -- GitLab