Skip to content Skip to sidebar Skip to footer

How To Download ".apk" As ".apk"? (not As ".zip")

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 them to '.zip'. I

Solution 1:

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

Solution 2:

For IIS7 and higher, add the following to the web.config of your application:

<system.webServer><staticContent><mimeMapfileExtension="apk"mimeType="application/vnd.android.package-archive" /></staticContent><system.webServer>

Solution 3:

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

<configuration><system.webServer><staticContent><mimeMapfileExtension=".apk"mimeType="application/vnd.android.package-archive" /></staticContent></system.webServer></configuration>

Solution 4:

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;
    ...
}

Solution 5:

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

Post a Comment for "How To Download ".apk" As ".apk"? (not As ".zip")"