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

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

问题描述

我有一个 windows azure 部署(一个网络角色),它根据请求将一对视频文件(mov 和 mp4)从 azure 存储中提取到它自己的本地 IIS 存储中,然后我通过浏览器访问.

这听起来可能很愚蠢,但我有充分的理由这样做.

很遗憾,我无法访问 mp4 文件.mov 很好,但 mp4 给我404 - 找不到文件或目录."

我已经调查过了,似乎是因为 IIS 不会返回未知的文件类型,而 mp4 必须属于这一类别.如果是普通的 IIS 服务器,我将能够注册 mp4 mime 类型,但我不知道如何在 Windows Azure 中进行此操作.

我可以在 RDP 中手动执行,但这不切实际,因为该角色经常更换,这意味着我每次都需要手动重新执行.它必须通过配置文件之一或在代码中完成.

有人可以帮忙吗?

谢谢!!

史蒂文

解决方案

你不能在 web.config 中添加自定义 mime 类型吗?我刚看到这个链接:

http://www.iis.net/ConfigReference/system.webServer/staticContent/mimeMap

相关的 web.config xml 是:

<预><代码><配置><system.webServer><静态内容><mimeMap fileExtension=".syx" mimeType="application/octet-stream"/><mimeMap fileExtension=".tab" mimeType="text/plain"/></staticContent></system.webServer></配置>

希望这会有所帮助.

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.

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

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.

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.

Can anyone help?

Thanks!!

Steven

解决方案

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

http://www.iis.net/ConfigReference/system.webServer/staticContent/mimeMap

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>

Hope this helps.

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

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