equitharn
equitharn

Reputation: 3482

can't download .apk file from server

I have an apk file on my server (which is hosted on Hostinger) CentOS OS

now I want users to download that file from my server.

but when I point the url to the apk location it says 404 page not found while I know there are entire web sites dedicated to doing it.

I tried modifying htaccess file

AddType application/octet-stream .apk

then

AddType application/vnd.android.package-archive .apk

then

<Files *.*>
ForceType application/octet-stream
</Files>

but that doesn't seem to work.

even tried doing this https://stackoverflow.com/a/28784154/4481968

PS. all other file formats get downloaded, even .APK file gets downloaded but not .apk (why is that?)

Upvotes: 4

Views: 4553

Answers (3)

maddy23285
maddy23285

Reputation: 786

I know it is already answered. But anyone still facing the issue even after making changes suggested above, change minifyEnabled true to minifyEnabled false if it is enabled in build.gradle file of your app.

Upvotes: 0

Mohd. Shaizad
Mohd. Shaizad

Reputation: 99

Create file with name .htaccess and just paste the below code in it and move this file on your server where your apk file is placed

AddType application/octet-stream .apk

AddType application/vnd.android.package-archive .apk

ForceType application/octet-stream

Upvotes: 0

SapuSeven
SapuSeven

Reputation: 1573

I just had the same problem with Hostinger and wrote to the support.

They said, .apk files are blocked for security reasons.

However, rename the file to .APK, that is working as well and you can reach it on your server.

Upvotes: 4

Related Questions