Windows Azure的 - 在Windows Azure中IIS存储即成未知(MP4)MIME类型 [英] Windows Azure - Serve unknown (mp4) MIME types in Windows Azure IIS storage

查看:223
本文介绍了Windows Azure的 - 在Windows Azure中IIS存储即成未知(MP4)MIME类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows Azure的部署(网络角色)的要求一对从Azure存储的视频文件(MOV和MP4)拉扯到它自己的本地IIS存储,然后我通过浏览器访问。

I have a windows azure deployment (a web-role) that on request pulls in a pair of video files (mov and mp4) from azure storage into it's own local IIS storage, which I then access through the browser.

这可能听起来很傻,但我必须这样做很好的理由。

It may sound silly, but I have good reasons for doing this.

不幸的是,我无法访问的mp4文件。该MOV都很好,但是MP4给我的404 - 找不到文件或目录

Unfortunately, I am unable to access the mp4 files. The mov are fine, but the mp4 give me "404 - File or directory not found."

我看过这个,这似乎是因为IIS将不会返回未知文件类型,和MP4必须属于这一类。如果这是一个正常的IIS服务器,我将能够注册MP4 MIME类型,但我不知道如何去这在Windows Azure中。

I've looked into this, and it seems to be because IIS will not return unknown file types, and mp4 must fall under this category. If it was a normal IIS server I would be able to register the mp4 mime type, but I don't know how to go about this in Windows Azure.

我可以在RDP和做手工,但随着角色频繁更换,并且将意味着我需要手动每次都重新做,这将是不实际的。它必须通过配置文件中的一个或code来完成。

I could RDP in and do it manually, but this would not be practical as the role is replaced frequently and would mean I would need to re-do it manually every time. It must be done through one of the config files or in code.

谁能帮助?

谢谢!

史蒂芬

推荐答案

你能不能在web.config中添加自定义MIME类型?我只是碰到了此链接:

Can you not add custom mime type in web.config? I just ran into this link:

<一个href=\"http://www.iis.net/ConfigReference/system.webServer/staticContent/mimeMap\">http://www.iis.net/ConfigReference/system.webServer/staticContent/mimeMap

相关web.config中的XML是:

The relevant web.config xml is:

<configuration>
   <system.webServer>
      <staticContent>
         <mimeMap fileExtension=".syx" mimeType="application/octet-stream" />
         <mimeMap fileExtension=".tab" mimeType="text/plain" />
      </staticContent>
   </system.webServer>
</configuration>

希望这有助于。

这篇关于Windows Azure的 - 在Windows Azure中IIS存储即成未知(MP4)MIME类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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