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
306 views
in Technique[技术] by (71.8m points)

c# - Windows Azure - Serve unknown (mp4) MIME types in Windows Azure IIS storage

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

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

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.


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

...