How can I get supported mime list on my mac

Hi,


How can I get the supported mime list on my mac, or the file extension - mime map?


When I use file.type(javascript code) to get the mime type of xls file, it always return emtpy.

But it works for other files like xlsx, doc file.

And it works on other OS.

According to google, Chrome itself doesn't keep the MIME type, it get the MIME type from OS. So I need to find the supported mime types on my mac.


Follow is my javascript code:

------------------------------------------------------------------------------------

function filechanged() {
var form = document.getElementById('TForm')
var file = form.getElementsByClassName('real-file-upload')[0].files[0];
//alert(file.name)
//alert(file.type)
document.getElementById('FileName').textContent=file.name
document.getElementById('FileType').textContent=file.type
}

------------------------------------------------------------------------------------

Complete code is as follows:

------------------------------------------------------------------------------------

<!DOCTYPE html>
<html>
<head>
<title>test upload</title>


<script>
function filechanged() {
var form = document.getElementById('TForm')
var file = form.getElementsByClassName('real-file-upload')[0].files[0];
//alert( file.name)
//alert(file.type)
document.getElementById('FileName').textContent= file.name
document.getElementById('FileType').textContent=file.type //if a xls file is selected, file.type return empty on my mac. But is works for xlsx, doc etc.
}
</script>
</head>
<body>
<form id='TForm'>
<input type='file' class='real-file-upload' onchange="filechanged()"/>
<br />
</form>
<br />
<label>File Name:</label><span id='FileName'></span>
<br />
<label>File type:</label><span id='FileType'></span>
</body>
</html>

------------------------------------------------------------------------------------

Thanks very much.

How can I get supported mime list on my mac
 
 
Q