本文介绍了无法从服务器下载 .apk 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的服务器上有一个 apk 文件(托管在 Hostinger 上)CentOS 操作系统

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.

但是当我将 url 指向 apk 位置时,它说找不到 404 页面,而我知道有整个网站专门用于执行此操作.

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.

我尝试修改 htaccess 文件

I tried modifying htaccess file

AddType application/octet-stream .apk

然后

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

然后

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

但这似乎不起作用.

甚至尝试这样做https://stackoverflow.com/a/28784154/4481968

附注.所有其他文件格式都会被下载,即使是 .APK 文件也会被下载,但不会是 .apk(为什么会这样?)

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

推荐答案

我刚刚在使用 Hostinger 时遇到了同样的问题并写信给支持人员.

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

他们说,出于安全原因,.apk 文件被阻止.

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

但是,将文件重命名为 .APK,这也能正常工作,您可以在服务器上访问它.

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

这篇关于无法从服务器下载 .apk 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 00:39
查看更多