Add file upload

This commit is contained in:
Bruno Rybársky 2024-04-25 10:30:22 +02:00
parent 74eef045d8
commit 93f6b38748

@ -164,7 +164,9 @@ function getUploadPath($type = "unknown", $filename = "hehe"): string
default => 'dummy',
};
if ($extension != "dummy") {
return "uploads/$type/$id/$date/$filename.$extension";
$basepath = "uploads/$type/$id/$date";
mkdir($basepath, 755, true);
return $basepath . "/$filename.$extension";
} else {
return "";
}