If I have an IPFS CID address (with no extension), of a
file like this for instance https://ipfs.infura.io/ipfs/QmNhq4hx1KfTw1a5pTtudGXm9Q4xhWdeuWtPSSG19SSZeU
, how can I find its MIME type using Javascript?
I've tried the following:
let file='https://ipfs.infura.io/ipfs/QmNhq4hx1KfTw1a5pTtudGXm9Q4xhWdeuWtPSSG19SSZeU'
if (window.FileReader && window.Blob) {
console.log("All the File APIs are supported by the browser.");
console.log("Type: " + file.type);
} else {
console.log("File and Blob are not supported by the browser");
}
This is always giving me undefined
.
Any help would be much appreciated.