Fix IE apk into zip:android mobile app file download server configuration workaround

Source: Internet
Author: User
Tags nginx server

The apk file is actually in the zip format, but the suffix name is modified to APK, after decompression through unzip, you can see the Dex file, Dex is the full name of Dalvik VM executes, that is, Android Dalvik execution program, not Java The bytecode of me is the Dalvik byte code.
Since the APK file itself is a compressed package, if the user's computer is loaded with WinRAR (85% installed capacity), using IE to download the apk file, the extension will be automatically changed to ". zip".

If your download server is an Nginx server, then in the Nginx installation directory of the Conf/mime.types file corresponding location, plus the following line of statements, the specified APK file MIME type is application/ Vnd.android.package-archive can:
Application/vnd.android.package-archive apk;

Note: The above configuration is only in the Nginx layer good, but if you are using Nginx+tomcat way, under IE will still become a zip

You also need to configure Conf/web.xml in Tomcat to specify the APK type
<mime-mapping>
<extension>apk</extension>
<mime-type>application/vnd.android.package-archive</mime-type>
</mime-mapping>

Note: When you re-test, you must turn off IE browser to restart one to take effect (closing tab bar does not work)


=================================================

Many users reflect that the website provided on the Android phone application file "xxx.apk", with IE browser download, the extension is automatically renamed as "Xxx.zip", copy to the phone can not be installed. I found that because the APK file itself is a compressed package, if the user's computer is loaded with WinRAR (85% installed capacity), using IE to download the apk file, the extension will be automatically changed to ". zip".

If your download server is an Nginx server, then in the Nginx installation directory of the Conf/mime.types file corresponding location, plus the following line of statements, the specified APK file MIME type is application/ Vnd.android.package-archive can:

Application/vnd.android.package-archive apk;

As of this publication, there are many sites where "xxx.apk" is automatically renamed as "Xxx.zip" when downloading, including some well-known websites that provide downloads for Android programs, such as Sina Weibo and street-side nets.

Sina Weibo official Android Mobile Client download page: http://t.sina.com.cn/mobile/android.php

The following is the configuration of the various file name suffixes in Nginx mime.types:
Text/vnd.sun.j2me.app-descriptor Jad;
application/java-archive jar War Ear;
Application/x-java-archive-diff Jardiff;
Application/vnd.android.package-archive apk;
Application/vnd.ms-cab-compressed cab;
Application/octet-stream bin EXE dll;
Application/vnd.symbian.install sis;
X-epoc/x-sisx-app Sisx;
Application/iphone PXL IPA;
Application/vnd.palm PRC PDB;
APPLICATION/VND.WEBOS.IPK IPK;
Application/vnd.rim.cod cod;
APPLICATION/MRP MRP;
X-nokia-widget Wgz;
Application/octet-stream Deb;

Fix IE apk into zip:android mobile app file download server configuration workaround

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.