android从IIS/asp.net下载apk文件

解决步骤:

1.web.config中

复制代码
<configuration>
  <configSections>
...
    <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" /><!--加入此行-->
  </configSections>
 ...
<system.web> <httpModules> <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter" /><!--加入此行--> </httpModules>
...
 </system.web>
...
<system.webServer>
    
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true"><!--加入此行-->
    </modules>
...
</configuration>

2. App_Start/RouteConfig.cs文件中  

复制代码
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{resource}.apk");// 加入此行
    
            ...
         }
      }
复制代码

3. IIS中配置MIME文件映射

.apk    application/vnd.android

posted @ 2017-05-24 13:23  枫-  阅读(297)  评论(0编辑  收藏  举报