I have made a Php program that downloads an Inno setup installation file for installing a program. However, if I for one or another reason want to make a new download of the same Inno setup installation file, the previous file will still be found in the Download folder. Each of the downloads get a number in parenthesis, setup(1), setup(2), setup(3) etc. However, I wondered if it is posible to erase the previous file in the same process as I download a new one, so that however many downloads I do, there will all the time only be one occurence of this file in the Download folder.
The download code is as follows:
$exe = "Inno script/Test_setup.exe";
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"Test_setup.exe\"");
header("Content-Length: " . filesize($exe));
readfile($exe);
Thanks in advance.
Sincerely