can php download exe files?
PHP can download exe files like download rar First fread in the output of the download, do not access the EXE file in the site's path to download, can you achieve this effect? PHP
------Solution--------------------
With the same request
Not as far as I know.
------Solution--------------------
Here you can add the code you want to add, such as:
/*
if (! ( $_server[' Http_referer ' && strpos ($_server[' http_referer '], ' http://'. $_server[' http_host ']) = = = 0)) {
Die (' prohibit off-station operation! ');
}
*/
Header (' Content-type:application/octet-stream '); EXE file in MIME format
Header (' content-disposition:attachment; Filename=yournewfilename.exe '); You want to download as a new file name
echo file_get_contents (' Yourfile.exe '); Fetch the file source, of course, here can also use fopen, fread read the file
?>
------Solution--------------------
Gets the path of the file, compressed and then downloaded.
------Solution--------------------
The key is that the header is set correctly, otherwise the file data may be displayed directly in the browser.
------Solution--------------------
The principle is feasible, depends on the service side configuration situation.
------Solution--------------------
Of course. You can also use the ReadFile () method to read the file
------Solution--------------------
PHP Script settings
Set_time_limit (0);
Give it a try? Is the file too large and timed out?