<?php
if (!isset($_GET['file']) || empty($_GET['file'])) {
    die('No PDF selected');
}

$file = basename($_GET['file']);

// Absolute server path (check ke liye)
$serverPath = __DIR__ . '/pdfs/' . $file;

if (!file_exists($serverPath)) {
    die('PDF not found on server');
}

// Browser URL
$pdfUrl = '/pdfs/' . rawurlencode($file);
?>