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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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