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');