Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to know when a MIME file is supported?

Status
Not open for further replies.

fairsayan

Programmer
Aug 27, 2005
3
IT
I would like to create a web page within a check list. For each MIME type this page will show "OK" is that MIME type is supported by the browser, otherwise "Warning".
Is this possible?
Thanks,
Fair
 
You would be able to build a web page that does that... but it would have to display information you have already gathered in previous tests. I know of no way to perform such tests locally within the browser.

Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
This time ff/nn has an edge. Msie has not implement (yet?) mimeTypes collection for (political) reasons? This works for ff/nn. In ie no runtime error as doc said for compatible reason, only it returns nothing.
[tt]
<html>
<head>
<script language="javascript">
function checkit() {
var cmimetypes=window.navigator.mimeTypes;
alert("mimeTypes collection length : " + cmimetypes.length);
var info="";
for (var i=0;i<cmimetypes.length;i++) {
info+="["+i+"] "+cmimetypes.type+"\n";
if ((i%25)==24) {
alert(info);
info="";
}
}
}
window.onload=checkit;
</script>
</head>
</html>
[/tt]
Different browser may report slightly different results.
 
Thanks a lot, it's exactly what I'm looking for! :)
Fair
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top