How about just ....
$file = 'some_file.exe'; $_size = filesize($_file); header('Content-Type: binary/octet-stream'); header('Content-Length: '.$_size); header('Content-Disposition: attachment; filename="' . basename($file) . '"; size=" . $_size); @readfile($file);
Note: see comment for some problems with binary files .
source share