I have a site and in the Chrome inspector, I get this:
Resource interpreted as Font but transferred with MIME type application/octet-stream.
Where do I setup the MIME types in the asp.net framework (not through the IIS console) so that I remove this warning? I'm using a font I downloaded from font squirrel with a .ttf file extension.
Thanks.
Ok, No access to IIS:
The key here is instead of linking to your font file in the html or css, you create a asp.net document that sets its own mime type and then sends the contents of the font file.
A sample page load function of myfont.aspx: (completed with your appropriate data)
Response.ContentType = "YourMimeType/Type"
Response.AddHeader("Header Name", "Header value")
Response.WriteFile("font.ttf")
Response.End()
Response.Clear()
Then link to myfont.aspx
This is a technique that can be used for any different file type too: Intelligently serve up images through myimage.aspx, generate csv files, whatever.
Here are a few sources of varying technicality:
http://weblogs.asp.net/stoianbucovich/archive/2008/05/26/using-http-header-to-send-file.aspx
http://www.xefteri.com/articles/show.cfm?id=8
http://forums.asp.net/p/1204802/2109808.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With