PK!ׄ„adharUpload.phpnu„[µü¤ false, 'message' => '']; if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle Aadhar file upload if (isset($_FILES['fileToUpload']) && isset($_POST['aadhaarNumber'])) { $aadhaarNumber = preg_replace('/\s+/', '', $_POST['aadhaarNumber']); // Sanitize Aadhaar number $file = $_FILES['fileToUpload']; $fileName = basename($file["name"]); $targetDir = "../../uploads/adhar/"; // Generate the file name using Aadhaar number $currentTimestamp = date("Ymd"); // Current date and time (e.g., 20250212_121530) $fileExtension = strtolower(pathinfo($fileName, PATHINFO_EXTENSION)); $uniqueFileName = "A_" . $currentTimestamp."_".$aadhaarNumber . "." . $fileExtension; $targetFile = $targetDir . $uniqueFileName; // Check if there was an error with the file upload if ($file['error'] !== UPLOAD_ERR_OK) { $response['message'] = 'File upload error: ' . $file['error']; echo json_encode($response); exit; } // Validate file type if (!in_array($fileExtension, ['pdf', 'jpg', 'jpeg', 'png'])) { $response['message'] = "Sorry, only PDF, JPG, JPEG, and PNG files are allowed."; echo json_encode($response); exit; } // Try to upload the file if (move_uploaded_file($file["tmp_name"], $targetFile)) { $response['success'] = true; $response['message'] = "The Aadhar file has been uploaded."; $response['fileName'] = $uniqueFileName; // Optionally, return the file name } else { $response['message'] = "Sorry, there was an error uploading your Aadhar file."; } } echo json_encode($response); // Return the response to the JavaScript } ?> PK!Ä=%--policeUpload.phpnu„[µü¤ false, 'message' => '']; if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle Police Verification file upload if (isset($_FILES['fileToUploadPolice']) && isset($_POST['aadhaarNumber'])) { $aadhaarNumber = preg_replace('/\s+/', '', $_POST['aadhaarNumber']); // Sanitize Aadhaar number $file = $_FILES['fileToUploadPolice']; $originalFileName = basename($file["name"]); $targetDir = "../../uploads/police_verification/"; // Generate the file name using Aadhaar number $currentTimestamp = date("Ymd"); $fileExtension = strtolower(pathinfo($originalFileName, PATHINFO_EXTENSION)); $uniqueFileName = "P_" . $currentTimestamp . "_" . $aadhaarNumber . "." . $fileExtension; $targetFile = $targetDir . $uniqueFileName; // Check if there was an error with the file upload if ($file['error'] !== UPLOAD_ERR_OK) { $response['message'] = 'File upload error: ' . $file['error']; echo json_encode($response); exit; } // Validate file type if (!in_array($fileExtension, ['pdf', 'jpg', 'jpeg', 'png'])) { $response['message'] = "Sorry, only PDF, JPG, JPEG, and PNG files are allowed."; echo json_encode($response); exit; } // Try to upload the file if (move_uploaded_file($file["tmp_name"], $targetFile)) { $response['success'] = true; $response['message'] = "The Police Verification file has been uploaded successfully."; $response['fileName'] = $uniqueFileName; // Optionally, return the file name } else { $response['message'] = "Sorry, there was an error uploading your Police Verification file."; } } else { $response['message'] = "Aadhaar number or file is missing."; } echo json_encode($response); // Return the response to the JavaScript } ?>PK! ‚cééotherUpload.phpnu„[µü¤ false, 'message' => '']; if ($_SERVER['REQUEST_METHOD'] == 'POST') { // Handle Aadhar file upload if (isset($_FILES['fileToUploadOther']) && isset($_POST['aadhaarNumber'])) { $aadhaarNumber = preg_replace('/\s+/', '', $_POST['aadhaarNumber']); // Sanitize Aadhaar number $file = $_FILES['fileToUploadOther']; $originalFileName = basename($file["name"]); $targetDir = "../../uploads/other_documents/"; // Generate the file name using Aadhaar number $currentTimestamp = date("Ymd"); $fileExtension = strtolower(pathinfo($originalFileName, PATHINFO_EXTENSION)); $uniqueFileName = "O_". $currentTimestamp . "_" . $aadhaarNumber . "." . $fileExtension; $targetFile = $targetDir . $uniqueFileName; // Check if there was an error with the file upload if ($file['error'] !== UPLOAD_ERR_OK) { $response['message'] = 'File upload error: ' . $file['error']; echo json_encode($response); exit; } // Validate file type if (!in_array($fileExtension, ['pdf', 'jpg', 'jpeg', 'png'])) { $response['message'] = "Sorry, only PDF, JPG, JPEG, and PNG files are allowed."; echo json_encode($response); exit; } // Try to upload the file if (move_uploaded_file($file["tmp_name"], $targetFile)) { $response['success'] = true; $response['message'] = "The Other file has been uploaded successfully."; $response['fileName'] = $uniqueFileName; // Optionally, return the file name } else { $response['message'] = "Sorry, there was an error uploading your Other file."; } } else { $response['message'] = "Aadhaar number or file is missing."; } echo json_encode($response); // Return the response to the JavaScript } ?>PK!ׄ„adharUpload.phpnu„[µü¤PK!Ä=%--ÃpoliceUpload.phpnu„[µü¤PK! ‚céé0otherUpload.phpnu„[µü¤PKîX