Answer the question
In order to leave comments, you need to log in
How to upload an exe file?
There is a code:
$file_d = '/download/tmp_file/'.$rand_name.'/qwerty.exe';
$file_n = 'qwerty.exe';
if (ob_get_level()) {
ob_end_clean();
}
// заставляем браузер показать окно сохранения файла
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . basename($file_n));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file_d));
// читаем файл и отправляем его пользователю
readfile($file_d);
exit;
header( 'Refresh: 0; url=/download/tmp_file/'.$rand_name.'/qwerty.exe' );
Answer the question
In order to leave comments, you need to log in
<?
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename: myfile.exe");
$fl = file_get_contents("myfile.exe");
echo $fl;
?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question