Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
    
Thanks. I'm seeing security guidance that says this in combination with a crossdomain.xml file will prevent XSS from user uploads & Flash –  makerofthings7 Mar 5 '12 at 14:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.