简体   繁体   English

使静态资源在Azure Web角色中可用

[英]Make static resource available in Azure Web Role

I need to access a web api in an Azure Web Role from a legacy Flash Application, and in order to do this Flash needs to be able to access a file called crossdomain.xml. 我需要从旧版Flash应用程序访问Azure Web角色中的Web api,并且为此,Flash需要能够访问名为crossdomain.xml的文件。 I have added this file to the root of the application, but if I go to https://myapp.com/crossdomain.xml in the browser the file is downloaded. 我已将此文件添加到应用程序的根目录,但是如果在浏览器中转到https://myapp.com/crossdomain.xml ,则会下载该文件。 How can I get the xml to be shown in the browser? 如何获取要在浏览器中显示的xml?

Static xml files can be served by adding the following to web.config: 可以通过将以下内容添加到web.config中来提供静态xml文件:

 <handlers>
    <add name="XMLHandler" type="System.Web.StaticFileHandler" path="*.xml" verb="GET"  />
</handlers>

 <staticContent>
      <mimeMap fileExtension=".xml" mimeType="application/xml" />
 </staticContent>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM