mirror of
https://github.com/myronblair/do-server-config
synced 2026-07-28 13:32:58 -05:00
[orbis] Weekly backup 2026-07-07 — 318 files changed, 48597 insertions(+), 7 deletions(-)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../includes/auth.php';
|
||||
header('Content-Type: application/json');
|
||||
|
||||
if (!AdminAuth::getUser()) {
|
||||
http_response_code(401);
|
||||
echo json_encode(['error' => 'Unauthorized']);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
|
||||
echo json_encode(['error' => 'No file received']); exit;
|
||||
}
|
||||
|
||||
$result = handleImageUpload('image', __DIR__ . '/../../uploads/splashes/', 'splash_');
|
||||
|
||||
if (isset($result['success'])) {
|
||||
echo json_encode(['success' => true, 'url' => '/uploads/splashes/' . $result['filename']]);
|
||||
} else {
|
||||
echo json_encode(['error' => $result['error']]);
|
||||
}
|
||||
Reference in New Issue
Block a user