Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
839 views
in Technique[技术] by (71.8m points)

fonts - What is the MIME type for TTF files?

I can't find correct MIME type for TrueType fonts. I need it because I'm using File Uploading Class (CodeIgniter) to upload files, and I want to allow only TTF to be uploaded. Tried this:

'ttf'   =>  'font/ttf'
'ttf'   =>  'font/truetype'

With no success.

Any ideas ?

question from:https://stackoverflow.com/questions/5128069/what-is-the-mime-type-for-ttf-files

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

TTF font files has the following MIME type: font/ttf.

Before February 2017:

TTF does not have a MIME type assigned. You'll have to use the more general application/octet-stream, which is used to indicate binary data with no assigned MIME type.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...