[文章作者:张宴 本文版本:v1.0 最后修改:2010.01.20 转载请注明原文链接:http://blog.zyan.cc/android_apk_zip]
前天,金山网络的一位同事向我咨询了一个问题:很多用户反映,网站上提供的Android手机应用程序文件“xxx.apk”,用IE浏览器下载,扩展名就被自动被重命名成了“xxx.zip”,拷贝到手机上无法安装。我发现,由于APK文件本身就是压缩包,如果用户的电脑上装了WinRAR(85%的装机量),用IE下载APK文件,扩展名就会被自动改为“.zip”。
如果你的下载服务器为Nginx服务器,那么,在Nginx安装目录下的conf/mime.types文件的对应位置,加上以下一行语句,指定APK文件的MIME类型为 application/vnd.android.package-archive 即可:
截至本文发布时,存在“xxx.apk”下载时被自动重命名为“xxx.zip”问题的网站很多,其中不乏一些提供 Android 程序下载的知名网站,例如:新浪微博、街旁网。
新浪微博官方 Android 手机客户端下载页:http://t.sina.com.cn/mobile/android.php


街旁 Android 版客户端下载页:http://we.jiepang.com/client-android/

增加APK文件的 MIME 类型后,用IE下载就正常了,例如:金山手机卫士、腾讯手机QQ
金山手机卫士下载页:http://m.ijinshan.com/


腾讯手机QQ Android版下载页:http://mobile.qq.com/2010/android/




前天,金山网络的一位同事向我咨询了一个问题:很多用户反映,网站上提供的Android手机应用程序文件“xxx.apk”,用IE浏览器下载,扩展名就被自动被重命名成了“xxx.zip”,拷贝到手机上无法安装。我发现,由于APK文件本身就是压缩包,如果用户的电脑上装了WinRAR(85%的装机量),用IE下载APK文件,扩展名就会被自动改为“.zip”。
如果你的下载服务器为Nginx服务器,那么,在Nginx安装目录下的conf/mime.types文件的对应位置,加上以下一行语句,指定APK文件的MIME类型为 application/vnd.android.package-archive 即可:
application/vnd.android.package-archive apk;
截至本文发布时,存在“xxx.apk”下载时被自动重命名为“xxx.zip”问题的网站很多,其中不乏一些提供 Android 程序下载的知名网站,例如:新浪微博、街旁网。
新浪微博官方 Android 手机客户端下载页:http://t.sina.com.cn/mobile/android.php


街旁 Android 版客户端下载页:http://we.jiepang.com/client-android/

增加APK文件的 MIME 类型后,用IE下载就正常了,例如:金山手机卫士、腾讯手机QQ
金山手机卫士下载页:http://m.ijinshan.com/


腾讯手机QQ Android版下载页:http://mobile.qq.com/2010/android/




不错啊!
平顶山论坛
白龟山论坛
good521
我的环境是 apache + svn_dav 读取 svn 里面的内容