Determining a Local File's Mime Type (Content-type) With PHP

Posted by Sonny on Stack Overflow See other posts from Stack Overflow or by Sonny
Published on 2010-03-16T15:06:08Z Indexed on 2010/03/16 15:11 UTC
Read the original article Hit count: 503

Filed under:
|
|
|

I am trying to determine a file's mime type. I've tried a few methods, but haven't come up with anything that gives consistent output. I've tried $mime = mime_content_type($file) and $mime = exec('file -bi ' . $file). I am serving up images, CSS, JavaScript, and images.

© Stack Overflow or respective owner

Related posts about php

Related posts about mime-type