I have these PHP headers that will force a download (Intranet site) that works on Chrome without prompting the popup, but I cannot avoid the popup warning in Internet Explorer 11 (Version 11.657.18362.0) on Windows 10.
I've tried adding to IE "intranet" site and "internet" site the internal server address this would run from (http://[server]), lower the security levels to the lowest settings for this zone under "intranet" and also "internet". Close and open Internet Explorer and it still has the popup warning.
Here is my PHP code below:
if ($_REQUEST['c']){
$num = $_REQUEST['c'];
$cmd = "test.exe $num";
$ctype ="application/octet-stream";
ob_end_clean();
header('Content-Description: File Transfer');
header('Content-Type:' . $ctype);
header('Content-Disposition: attachment; filename="test.bat"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: public');
header('Content-Length: ' . strlen($cmd));
echo($cmd);
exit;
}
Additionally, once the bat file has downloaded, there is a separate AutoIt script on the user's computer that will scan the download folder for this specific file and will automatically run the file and delete it without the user having to do anything. The idea is to limit the user's clicking to just one time.
This is the popup that I get from IE when I click to download the bat file below:
Any ideas what's wrong or other suggestions around this?