Downloading .apk turns into .txt on the phone

I have two apks on my website . I can click the link and download it to my computer, and it works great. When I download them to my phone, the first one works fine, and the second one loads as .txt instead of .apk. I can go on my phone and rename the file as apk, and then it works fine. But why does it appear as .txt and how do I make it stop? Thanks!

+4
source share
2 answers

While I cannot explain that the problem arises from only one file out of two, a review of the headers sent to mediafire.com indicates that the file is being sent with the text / plain content type. Perhaps android browsers look at this header and add the extension .txt. Since this is not under your control, it is best to place the files on your own server and add the mime type application / vnd.android.package-archive for the .apk extension.

+4
source

Try removing the plus sign (+) from the file name and see if it matters.

0
source

Source: https://habr.com/ru/post/1339264/


All Articles