1

I am trying to set the MIME type for Flash's cross domain file in web.config. Since this file has an extension of .XML the following command will edit the MIME type of all XML documents in my site (not wanted)

  <system.webServer>
  <staticContent>
      <mimeMap fileExtension="xml" mimeType="text/x-cross-domain-policy"/>
    </staticContent>
  </system.webServer>

How do I make this only affect the one file, crossdomain.xml

makerofthings7
  • 8,911
  • 34
  • 121
  • 197

1 Answers1

0

In the web.config file at that location, something like:

<location path="crossdomain.xml">
    <system.webServer>
        <staticContent>
            <clear />
            <mimeMap fileExtension=".xml" mimeType="text/x-cross-domain-policy" />
        </staticContent>
    </system.webServer>
</location>

Would be my guess.

(Tales From Behind The Curtain) That's a slight variation on what the UI does, which is worth explaining because it's not easily discoverable - to edit a setting for a particular file but not the folder, you can go to the Content view tab in that folder, then pick the file you're interested in, right-click it and choose Features View. That targets just that file (as can be confirmed in the pane at the left, and in the status bar when you're editing a feature).

It Removed and Add -ed the type, but I find that fragile, so I put a Clear in there instead.

TristanK
  • 9,073
  • 2
  • 28
  • 39
  • Thanks. I'm seeing security guidance that says this [in combination with a crossdomain.xml file](http://security.stackexchange.com/q/12413/396) will prevent XSS from user uploads & Flash – makerofthings7 Mar 05 '12 at 14:38