Fix minore caricamento allegati via API

This commit is contained in:
Dasc3er 2021-07-29 17:59:01 +02:00
parent d9bb35c33c
commit 921d357b9d
1 changed files with 1 additions and 9 deletions

View File

@ -87,13 +87,6 @@ class AllegatiInterventi extends AppResource
return $record; return $record;
} }
public static function getTempDirectory()
{
return DIRECTORY_SEPARATOR.
trim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).
DIRECTORY_SEPARATOR;
}
public function createRecord($data) public function createRecord($data)
{ {
$module = Modules::get('Interventi'); $module = Modules::get('Interventi');
@ -104,8 +97,7 @@ class AllegatiInterventi extends AppResource
throw new InternalError(); throw new InternalError();
} }
$file = self::getTempDirectory().$data['nome']; $file = temp_file($data['nome']);
//$path = stream_get_meta_data($file)['uri'];
file_put_contents($file, base64_decode($content[1])); file_put_contents($file, base64_decode($content[1]));
// Salvataggio del file come allegato // Salvataggio del file come allegato