From 921d357b9da8e54f4db86629aa8260cb414fc065 Mon Sep 17 00:00:00 2001 From: Dasc3er Date: Thu, 29 Jul 2021 17:59:01 +0200 Subject: [PATCH] Fix minore caricamento allegati via API --- src/API/App/v1/AllegatiInterventi.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/API/App/v1/AllegatiInterventi.php b/src/API/App/v1/AllegatiInterventi.php index 064dc3192..7a51d567f 100644 --- a/src/API/App/v1/AllegatiInterventi.php +++ b/src/API/App/v1/AllegatiInterventi.php @@ -87,13 +87,6 @@ class AllegatiInterventi extends AppResource return $record; } - public static function getTempDirectory() - { - return DIRECTORY_SEPARATOR. - trim(sys_get_temp_dir(), DIRECTORY_SEPARATOR). - DIRECTORY_SEPARATOR; - } - public function createRecord($data) { $module = Modules::get('Interventi'); @@ -104,8 +97,7 @@ class AllegatiInterventi extends AppResource throw new InternalError(); } - $file = self::getTempDirectory().$data['nome']; - //$path = stream_get_meta_data($file)['uri']; + $file = temp_file($data['nome']); file_put_contents($file, base64_decode($content[1])); // Salvataggio del file come allegato