The message "This type of file may harm your computer" in IE9

Why, if I directly link the * .exe file as follows:

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

I don’t get the IE9 message: β€œThis type of file may harm your computer”, and when the next approach to the PHP file comes up, a message appears?

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

Thank.

+3
source share
1 answer

You must add the following headers:

  • Add header information Content-Length.
  • Install Content-Transfer-Encodingto binary.

Also, is the file transferred from a secure URL? (Https).

0
source

All Articles