无法托管在Azure网站上的MP4文件 [英] Unable to host MP4 files on Azure web site

查看:233
本文介绍了无法托管在Azure网站上的MP4文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我托管在Azure中的保留网站(它是PaaS的,没有进入OS / IIS)的静态网站。我想补充一些.MP4影片,但是当我点击链接我得到

I am hosting a static website on a reserved web site in Azure (It is PaaS, no access to OS/IIS). I am trying to add some .mp4 videos but when I click on the links I get

The resource you are looking for has been removed, had its name changed, 
or is temporarily unavailable.

请在这里看到例如
如果我在链接上点击右键并试图保存的文件,我得到 - 失败 - 没有文件

Please see example here. If I right click on the link and try to save file I get - Failed - No file.

我使用的是付费的实例,所以不要认为这是资源问题。视频文件小于2MB。他们从来没有工作过。该网站是非常静态的。

I am using a paid instance so don't think it is resource issue. The video files are less than 2MB. They have never worked. The site is very static.

有谁知道我怎么能解决这个问题?
我应该在一些其他的方式托管MP4文件?

Does anyone know how I can resolve this? Should I be hosting MP4 files in some other way?

谢谢,

推荐答案

链接这样,请回答概念为我工作,但它没有指出适当fileExtension。我的配置不得不代替指示以下内容。 (注意,对于任何谁都有这样的疑问,在默认情况下我蔚蓝的网站没有一个web.config开始,所以我只好下面添加到一个文本文件,另存为web.config中,和FTP我的根目录。

The linked SO answer worked for me conceptually, but it didn't indicate the appropriate fileExtension. My config had to instead indicate the following. (Note, for any who have this question, by default my azure website didn't have a web.config initially, so I had to add the following to a text file, save as web.config, and FTP to my webroot.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
               <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
               <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
     </staticContent>
    </system.webServer>
</configuration>

这篇关于无法托管在Azure网站上的MP4文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆