feat: complete WebGIS implementation with nominal bantuan and cache busting

This commit is contained in:
fananazril
2026-06-11 19:18:25 +07:00
parent 0d59e629bd
commit 0ae2768849
36 changed files with 7687 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
// ================================================================
// API: File Upload
// ================================================================
require_once __DIR__ . '/../config/config.php';
require_once __DIR__ . '/../includes/functions.php';
header('Content-Type: application/json; charset=utf-8');
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
jsonResponse(['success' => false, 'message' => 'Method harus POST'], 405);
}
if (empty($_FILES['file'])) {
jsonResponse(['success' => false, 'message' => 'Tidak ada file yang diupload'], 400);
}
$file = $_FILES['file'];
$prefix = sanitize($_POST['prefix'] ?? 'upload');
$filename = handleUpload($file, $prefix);
if (!$filename) {
jsonResponse(['success' => false, 'message' => 'Upload gagal. Pastikan tipe file dan ukuran sesuai (maks 10MB, tipe: jpg/jpeg/png/gif/pdf/doc/docx)'], 422);
}
jsonResponse([
'success' => true,
'filename' => $filename,
'url' => UPLOAD_URL . $filename,
'message' => 'File berhasil diupload',
]);