防止IE将.apk,.xap和.ipa扩展名更改为.zip(Apache)

时间:2020-03-21 11:49:41  来源:igfitidea点击:

在Internet Explorer .apk中,.xap和.ipa扩展名将被删除,而以.zip代替。

修复

在Ubuntu 14.04上使用Apache 2.4。

$apachectl -v
Server version: Apache/2.4.7 (Ubuntu)
Server built:   May 22 2014 14:36:38

将以下文件添加到/etc/mime.conf中:

# Android
application/vnd.android.package-archive         apk
# Windows phone
application/x-silverlight-app                   xap
# iPhone
application/octet-stream                        ipa

启用Apache标头模块:

# a2enmod headers

在的配置文件中添加以下几行:

Header set Content-Disposition attachment

重新启动Apache服务。

# service apache2 restart