From ecd1b0f286b46de050e2b1e825d701c78309efb4 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sun, 6 Oct 2024 01:39:36 +0300 Subject: [PATCH] fix upload to folder if images placed on server --- .gitignore | 1 + app/Services/Upload.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 08507e6..876a6b1 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ ngallery.yaml views/pages/t.php rules.txt rules.txt +/uploads/* diff --git a/app/Services/Upload.php b/app/Services/Upload.php index 8a703f8..b316471 100644 --- a/app/Services/Upload.php +++ b/app/Services/Upload.php @@ -63,7 +63,7 @@ class Upload } else { - @mkdir ("{$_SERVER['DOCUMENT_ROOT']}/uploads/{$location}"); + mkdir("{$_SERVER['DOCUMENT_ROOT']}/uploads/{$location}", 0777, true); move_uploaded_file ($tmpname, "{$_SERVER['DOCUMENT_ROOT']}/uploads/{$folder}"); $this->type = $type;