android從IIS/asp.net下載apk檔案

發表於2017-05-24

解決步驟:

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

相關文章