Made so it's possible to configure more directories as constants

More flexibility for the user.
This commit is contained in:
slawkens
2023-02-02 18:53:56 +01:00
parent 708aa2d72f
commit 74d013049d
12 changed files with 37 additions and 31 deletions

View File

@@ -15,7 +15,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
return;
}
$imageFolder = BASE . 'images/editor';
$imageFolder = BASE . EDITOR_IMAGES_DIR;
reset ($_FILES);
$temp = current($_FILES);
@@ -43,7 +43,7 @@ if (is_uploaded_file($temp['tmp_name'])) {
move_uploaded_file($temp['tmp_name'], $fileToWrite);
$returnPathToImage = BASE_URL . 'images/editor/' . $randomName;
$returnPathToImage = BASE_URL . EDITOR_IMAGES_DIR . $randomName;
echo json_encode(['location' => $returnPathToImage]);
} else {
// Notify editor that the upload failed