Some time ago, the company developed the javaee project and the website provided download for Android applications. The results showed that the APK files downloaded by many 3G online users were changed to zip files, but the database is stored in the APK file path, recently cannot be understood, our company uses apache-tomcat7, I took a look at tomcat, it is found that there is a file web under conf under the apache-tomcat7. XML file. Many file types are configured, such:
<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 file, so Tomcat should convert it to a zip file! I added the <web-app>
<mime-mapping> <extension>apk</extension> <mime-type>application/apk</mime-type> </mime-mapping>
Restart Tomcat and finally download the APK file! Haha
(Note: The server used at that time is a Linux Server)