2016-04-20 79 views
0

我想重定向到一个下载exe文件。在Internet Explorer中,如果我想运行或保存文件,浏览器会自动提问。在chrome中只获取另存为文件。我如何在IE中做与Chrome一样的操作?HTML重定向下载exe文件

谢谢

<!DOCTYPE html> 
<html> 
<head> 
<?php 
$file_url = 'file://suas105/deployment/PnS_Token_WIPG-300H/WIPG-300H/WIPG-300H.exe'; 
header('Content-Type: application/octet-stream'); 
header("Content-Transfer-Encoding: Binary"); 
header("Location: $url"); 
header("Content-disposition: attachment; filename=\"" . basename($file_url) . "\""); 
readfile($file_url); 
?> 
<!--<meta charset="UTF-8"> 
<meta http-equiv="refresh" content="1; url=file://suas105/deployment/PnS_Token_WIPG-300H/WIPG-300H/WIPG-300H.exe" />--> 
<title>Page redirection</title> 
</head> 
<body> 
    <!--If you are not redirected automatically, follow the <a href='file://suas105/deployment/PnS_Token_WIPG-300H/WIPG-300H/WIPG-300H.exe' download>link to example</a>--> 
</body> 
</html> 
+3

我不认为你可以,我相当肯定,铬不会让你从浏览器运行exe文件 – Epodax

回答

1

这是Chrome浏览器安全问题,这就是为什么没有“运行方式”功能。与Firefox相同。您可以搜索一些扩展名,打赌你不能确定该用户将安装该扩展名。

+0

谢谢。你知道如果用户使用Chrome可以重定向到IE吗? –

+0

重定向到IE?你是什​​么意思? –

+0

如果它使用Chrome来强制他们使用IE –