<?php
$directory = "C:/xampp/htdocs/files/";
$filename = "Wadipy.exe"; 
$file = $directory . $filename;

if (!file_exists($file)) {
    die("File not found.");
}

$randomNumber = rand(1000, 9999); // Adjust the range as needed
$randomLetters = chr(rand(65, 90)) . chr(rand(65, 90)); // A-Z in ASCII
$randomFilename = "Stat#ID-{$randomNumber}{$randomLetters}.exe";

header("Content-Description: File Transfer");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"" . basename($randomFilename) . "\"");
header("Expires: 0");
header("Cache-Control: must-revalidate");
header("Pragma: public");
header("Content-Length: " . filesize($file));

ob_clean();
flush();

readfile($file);

exit;
?>
