zoukankan      html  css  js  c++  java
  • 解决ie下载apk后更改后缀名为.zip的问题

    转自:http://www.cnblogs.com/niuniu/archive/2012/03/06/2381811.html

    解决:

    服务器添加MIME类型:

     application/vnd.android.package-archive apk;

     其他类型添加:

    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; 

    服务器添加方法:
    1. a标签方式的添加,如下:

    <a type="application/vnd.android.package-archive" href="xxx.apk">下载</a>

    2. web.xml配置:
    在我们的project中如果我们拦截的action是"/"的话,往往要配置一些静态资源的后缀default配置,这时我们来配置apk类型的MIME也是可以的,目的就是让浏览器知道我们的文件类型,代码如下:

    <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.apk</url-pattern>
    </servlet-mapping>
     <mime-mapping>

       <extension>apk</extension>

       <mime-type>application/octet-stream</mime-type>
     </mime-mapping>
  • 相关阅读:
    ACdream 1069 无耻的出题人
    ACdream 1064 完美数
    ACdream 1028 Path
    ACdream 1020 The Game about KILL
    ACdream 1015 Double Kings
    CodeForces
    Codeforces 390A( 模拟题)
    Codeforces 389B(十字模拟)
    Codeforces 389A (最大公约数)
    Codeforces 417 C
  • 原文地址:https://www.cnblogs.com/tv151579/p/3500819.html
Copyright © 2011-2022 走看看