Azure Lei Zhang的博客

weibo: LeiZhang的微博/QQ: 185165016/QQ群:319036205/邮箱:leizhang1984@outlook.com/TeL:139-161-22926

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

  《Windows Azure Platform 系列文章目录

 

  在笔者之前的文章中,介绍了我们在使用Azure Web App,可以把静态资源保存到Azure Storage中:

  Windows Azure HandBook (7) 基于Azure Web App的企业官网改造

  这样动态的请求会发送到Azure Web App,静态的图片请求会发送到Azure Storage中

  减少Azure Web App对于主机带宽的压力。

 

  但是在某些时候,我们还是会把静态资源放在和Web代码里。比如我们部署的Web App代码是正常的。

  

 

  然后在这个ASP.NET代码目录里,有一个MP4文件。如下图:

  

 

  但是我们访问这个MP4页面,会发现404 Page Not Found:

  

 

  这个问题的主要原因是,Web App针对MP4文件没有设置MIME。

  我们可以修改Web App的Web.config文件,增加MIME配置,如下图:

<configuration>
    <system.webServer>
      <staticContent>
        <mimeMap fileExtension=".mp4" mimeType="video/mp4"/>
      </staticContent>
    </system.webServer>
</configuration>

  

  这样Web App就能正常播放MP4文件了:

  

  

posted on 2017-04-19 15:49  Lei Zhang的博客  阅读(517)  评论(0编辑  收藏  举报