Azure应用程序服务:无法下载APK文件



我正在尝试从我的Azure网站下载APK文件(Android软件包文件(。我有一个非常简单的虚拟应用程序,带有文件和提供下载链接的index.html页面。以下是index.html文件内容:

<a href="com.curiasystems.jcms.droid.parking.apk" download> Download Link </a>

APK已通过FTP上传到网站。

当网站呈现并显示链接时,文件无法下载。以下是Chrome给我的错误:

此错误意味着您试图下载的文件存在于此网站上或已移动到该网站的其他区域。

若要修复此错误,请与网站所有者联系,或尝试查找文件在另一个网站上。

以下是我为此所做的测试。我将文件重命名为"zip",并更新了下载链接和作为zip文件下载的文件。我在web.config中添加了一个mimeMap设置。这里是条目:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<rewrite>
<rules>
<rule name="WordPress: https://www.mywebsite.com/staging" patternSyntax="Wildcard">
<match url="*"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
</conditions>
<action type="Rewrite" url="index.php"/>
</rule>
</rules>
</rewrite>
<staticContent>
<clientCache cacheControlMaxAge="30.00:00:00" cacheControlMode="UseMaxAge"/>
<mimeMap fileExtension=".apk" mimeType="application/vnd.android.package-archive" />
</staticContent>
</system.webServer>
</location>
</configuration>

我还重新启动了应用程序服务,以确保web.config生效。

任何帮助都将不胜感激。

谢谢,Hapster

我希望这能帮助到别人,我发现了问题,我把mime类型添加到了错误的web.config文件中。一旦我纠正了这一点,效果就很好。

最新更新