How to download “.apk” as “.apk”? (not as “.zip”)

后端 未结 7 1967
天命终不由人
天命终不由人 2020-12-16 13:51

I have a small problem. Some browsers are not downloading the \".apk\" files correctly. How to download \".apk\" as \".apk\"? (not as \".zip\") Some browsers are convert the

相关标签:
7条回答
  • 2020-12-16 13:57

    Create a MIME-TYPE mapping of apk to application/vnd.android.package-archive. How you do this will vary on your web server.

    0 讨论(0)
  • 2020-12-16 13:59

    This worked for me -

    It's a known issue but easy to fix.

    1. Login to the Web server using SSH

    2. Verify that the apk mime doesn't exist in nginx mime.types by running:

    cat /etc/nginx/mime.types

    1. Add apk mime type application/vnd.android.package-archive apk; into mime.types file using nano tool or vi (make sure it is inside the 'types{}')

    nano /etc/nginx/mime.types

    1. Restart nginx service

    /etc/init.d/nginx restart

    0 讨论(0)
  • 2020-12-16 14:01

    Commit an answer for Nginx:

    Add this line in mime.types,

    application/vnd.android.package-archive     apk;

    If this won't work, try to return an explicit header for *.apk in your site conf,

    location ~* \.(apk)$ {
        add_header Content-Type application/vnd.android.package-archive;
        ...
    }
    
    0 讨论(0)
  • For IIS7 and higher, add the following to the web.config of your application:

    <system.webServer>
       <staticContent>
         <mimeMap fileExtension="apk" mimeType="application/vnd.android.package-archive" />
       </staticContent>
    <system.webServer>
    
    0 讨论(0)
  • 2020-12-16 14:08

    Please Change the MIME-TYPE mapping of apk to application/vnd.android.package-archive

    How to add a MIME type to a Web site or application 1. Open Internet Information Services (IIS) Manager: o If you are using Windows Server 2008 or Windows Server 2008 R2: § On the taskbar, click Start, point to Administrative Tools, and then click Internet Information Services (IIS) Manager. o If you are using Windows Vista or Windows 7: § On the taskbar, click Start, and then click Control Panel. § Double-click Administrative Tools, and then double-click Internet Information Services (IIS) Manager. 2. In the Connections pane, go to the site, application, or directory for which you want to add a MIME type. 3. In the Home pane, double-click MIME Types.

    1. In the MIME Types pane, click Add... in the Actions pane.

    2. In the Add MIME Type dialog box, add the file name extension as .apk and MIME type as application/vnd.android.package-archive, and then click OK.

    0 讨论(0)
  • 2020-12-16 14:09

    You can also set in web.config for local server for downloading apk

    <configuration>
       <system.webServer>
          <staticContent>
             <mimeMap fileExtension=".apk" mimeType="application/vnd.android.package-archive" />
          </staticContent>
       </system.webServer>
    </configuration>
    
    0 讨论(0)
提交回复
热议问题