Uploading the apk file for Android app becomes the solution reproduced under the zip-network

Source: Internet
Author: User
Tags nginx server

Download apk file for Android app and turn it into a zip--on-line solution

Download apk file for Android app and turn it into a zip--on-line solution

  Solution One,

Recently put the development of Android apps on the company's website, with IE downloaded after the problem: the extension. apk file Click to download and then become a. zip file, copied to the phone can not be installed.
If your download server is a tomcat server, then the location of the Conf/web.xml file in the Tomcat installation directory, plus the following line of statements, specifies that the MIME type of the APK file is application/ Vnd.android.package-archive can:

<mime-mapping> <extension>apk</extension> <mime-type>application/ Vnd.android.package-archive</mime-type> </mime-mapping>

----------------------------------------------------

  Solution II,

Some time ago, the company developed a Java EE project, the website provides the download of Android application, the results found that many 3G Internet users downloaded APK file has become a zip file, but the database is stored in the APK file path, the recent baffled solution, Our company is using APACHE-TOMCAT7, I looked at Tomcat, found under the APACHE-TOMCAT7 under the Conf a file Web. xml file, found that there are many file types, such as:

<mime-mapping> <extension>wspolicy</extension> <mime-type>application/wspolicy+xml</ mime-type> </mime-mapping> <mime-mapping> <extension>Z</extension> <mime-type> application/x-compress</mime-type> </mime-mapping> <mime-mapping> <extension>z</ extension> <mime-type>application/x-compress</mime-type> </mime-mapping> <mime-mapping > <extension>zip</extension> <mime-type>application/zip</mime-type> </mime-mapping >

I think the Android app is a compressed type of file, so it should be tomcat to switch to a ZIP file! I added it in <web-app>.

<mime-mapping> <extension>apk</extension> <mime-type>application/apk</mime-type> </mime-mapping>

Restart Tomcat and discover that you can finally download the APK file! Oh
(Special note: The server used at the time is a Linux server)

----------------------------------------------------

  Solution III,

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;

There are many websites that are automatically renamed "Xxx.zip" when "xxx.apk" is downloaded, including some well-known websites that offer Android programs to download.

Uploading the apk file for Android app becomes the solution reproduced under the zip-network

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.