IE9中的“此类文件可能会损害您的计算机”消息

时间:2011-05-30 07:57:26

标签: php download internet-explorer-9 exe

为什么我以下列方式直接链接* .exe文件:

<a href="http://download.domain.com/setup.exe">Download setup</a>

我没有收到IE9消息:“这种类型的文件可能会损害您的计算机”,而使用以下PHP文件服务方法时,消息会弹出?

header("Content-type:application/octet-stream");
header("Content-Disposition: attachment; filename=setup.exe");
readfile("http://download.domain.com/setup.exe");

感谢。

1 个答案:

答案 0 :(得分:0)

您应该添加以下标题:

  1. 添加Content-Length标题信息。
  2. Content-Transfer-Encoding设置为二进制。
  3. 此外,文件是从安全网址传输的吗? (HTTPS)。