title: ASP NET MVC on IIS 7.5 Serving SVGs with Proper Type
body: <p>This is closely related to other questions, but my specific question is why these two scenarios produce different behaviors.</p>
  
  <ol>
  <li><p><code>FilePathResult</code> with MIME type argument...</p>
  
  <pre><code>public FilePathResult PlainLogoSvg()
  {
          return File(Server.MapPath("~/Art/LogoPlain.svg"), "image/svg+xml");
  }
  </code></pre>
  
  <p>and this in the view</p>
  
  <pre><code>&lt;object class="centeredLogo" &gt;
  &lt;embed class="centeredLogo" src="@Url.Action("PlainLogoSvg")"/&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>produce an embedded image on Chrome and FF.</p></li>
  <li><p>Object or embed element (any combo/permutation) with src and type (this MIME type is configured -- by default -- on IIS 7.5)...</p>
  
  <pre><code>&lt;object class="centeredLogo" src="@Server.MapPath("~/Art/LogoPlain.svg")" type="image/svg+xml" &gt;
  &lt;embed class="centeredLogo" src="@Server.MapPath("~/Art/LogoPlain.svg")" type="image/svg+xml"/&gt;
  &lt;/object&gt;
  </code></pre>
  
  <p>break both Chrome and FF (FF cries for a plugin). Using <code>Url.Content</code> fixes it for Firefox.</p></li>
  </ol>