From 53533d4dfbb85b3744b004de1d0ea46aa6ec3ec9 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 22 Jul 2021 16:23:54 +0000 Subject: [PATCH] wip #4613 @0.25 --- inc/ws/Controlleur/class.ws.flash.php | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.flash.php b/inc/ws/Controlleur/class.ws.flash.php index 0f6ed14c2..b5794c470 100644 --- a/inc/ws/Controlleur/class.ws.flash.php +++ b/inc/ws/Controlleur/class.ws.flash.php @@ -206,22 +206,18 @@ class wsFlash extends cubeFlashGateway if ($infos['error']) { continue; } - $fname = cubeFiles::tidyName($infos['name']); - $res = $fname; - $dir = WS_THEMES . '/' . $this->args['theme_id'] . '/'; - $dest = $dir . $fname; + $fname = $this->args['fieldname'] . '_' . cubeFiles::tidyName($infos['name']); - if (!file_exists(WS_THEMES . '/' . $this->args['theme_id'])) { - mkdir(WS_THEMES . '/' . $this->args['theme_id'], 0755, true); - } + $tmp = sys_get_temp_dir() . '/' . $fname; + move_uploaded_file($infos['tmp_name'],$tmp); - move_uploaded_file($infos['tmp_name'], $dest); - try { - $api = new ws3API(); - $api->uploadThemeFile($this->args['theme_id'], $this->args['fieldname'], $dest); - } catch (Exception $e) { + $api = new ws3API(); + $api->uploadThemeFile($this->args['theme_id'], $this->args['fieldname'], $tmp); + + + $dir = WS_FILES . '/themes3/' . $this->args['theme_id']; + $dest = $dir . '/' . $fname; - } if (isset($this->args['type']) && $this->args['type'] == 'favicon') { $icotool = new cubeCommandLine('icotool'); -- 2.39.5