Home > Backend Development > PHP Tutorial > 通过PHP下载的应用程序文件无法运行怎么办?

通过PHP下载的应用程序文件无法运行怎么办?

WBOY
Release: 2016-06-23 13:25:35
Original
1093 people have browsed it

网站里放了个exe文件,然后通过如下代码下载下来之后发现无法运行,而且就连图标都丢了,是什么原因呢?

		$fs = fopen($_finame,'r');		$_fisize = filesize($_finame);		Header("Content-type: application/octet-stream");		Header("Accept-Ranges: bytes");		Header("Accept-Length: ".$_fisize);		Header("Content-Disposition: attachment; filename=".basename($_finame));		$buffer = 512;		while(!feof($fs)){			$_fidata = fread($fs,$buffer);			echo $_fidata;		}		fclose($fs);
Copy after login


在线等。。。


回复讨论(解决方案)

原来要放在压缩包里才行啊。。。

自己解决了这是。。

原来要放在压缩包里才行啊。。。

解决是解决了,但我问题一大堆。。为什么exe文件要被重新编码为毛放进rar就没事。但是这些问题却需要新开一贴来讨论。。。所以结贴。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template