diff --git a/lib/upload.php b/lib/upload.php index 4145600..6c7aa5d 100644 --- a/lib/upload.php +++ b/lib/upload.php @@ -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 ""; }