Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
214 views
in Technique[技术] by (71.8m points)

Unable to host MP4 files on Azure web site

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.

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.

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

Thanks,

question from:https://stackoverflow.com/questions/17151819/unable-to-host-mp4-files-on-azure-web-site

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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>
               <remove fileExtension=".mp4" />
               <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
               <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
     </staticContent>
    </system.webServer>
</configuration>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...