It's sort of working...
I have this:
<?php
$filepath='/home/mydomain/download/pf003/';
$filename='filename_1.1.9.exe';
header('Content-Disposition:attachment; filename="'.$filename.'"');
header('Content-type:application/octet-stream');
header('Pragma:no-cache');
header('Expires:0');
if ($file=fopen($filepath.$filename,'r')) {
fpassthru($file);
fclose($file);
}
There is one other file in that directory, a version.txt file with version number inside. If I rename the .exe in that directory to, say, file001.exe, it still downloads it as filename_1.1.9.exe but the file is corrupt.
How does it know which file to pick out of that directory, ie the text file or the exe?