Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if a browser supports a specific MIME type?

Tags:

browser

php

mime

How can i check if the browser supports a specific mime type with php?

like image 244
tarnfeld Avatar asked Jan 31 '10 13:01

tarnfeld


1 Answers

You could analyze the Accept header field to see if the type or a superset of that type is listed.

But notice that Accept is a list of rated values and a quality value of 0 means not accepted. And browsers send different Accept values based on their expectations for that resource (e.g. a resource referenced in IMG element is expected to be an element of image/*).

like image 177
Gumbo Avatar answered Sep 20 '22 06:09

Gumbo