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.
I used suggestion from https://social.msdn.microsoft.com/Forums/azure/en-US/79eb0c22-fe78-41d6-ac57-03055610b2a8/mp4-media-files-on-azure-website?forum=windowsazurewebsitespreview&prof=required:
<staticContent>
<remove fileExtension=".mp4"/>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
</staticContent>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With