Heim >Backend-Entwicklung >PHP-Tutorial >通过PHP下载的应用程序文件无法运行怎么处理
通过PHP下载的应用程序文件无法运行怎么办?
网站里放了个exe文件,然后通过如下代码下载下来之后发现无法运行,而且就连图标都丢了,是什么原因呢?
<br /> $fs = fopen($_finame,'r');<br /> $_fisize = filesize($_finame);<br /> Header("Content-type: application/octet-stream");<br /> Header("Accept-Ranges: bytes");<br /> Header("Accept-Length: ".$_fisize);<br /> Header("Content-Disposition: attachment; filename=".basename($_finame));<br /> $buffer = 512;<br /> while(!feof($fs)){<br /> $_fidata = fread($fs,$buffer);<br /> echo $_fidata;<br /> }<br /> fclose($fs);<br />