Fixes for attachments

This commit is contained in:
David Bomba 2021-02-11 19:04:40 +11:00
parent e11592e172
commit 1eb396f300

View File

@ -25,7 +25,11 @@ class TempFile
public static function filePath($data, $filename) :string
{
$file_path = sys_get_temp_dir().'/'.sha1(microtime() . '/' . $filename);
$dir_hash = sys_get_temp_dir().'/'.sha1(microtime());
mkdir($dir_hash);
$file_path = $dir_hash . '/' . $filename;
file_put_contents($file_path, $data);