I am working on an API which is fetching file data as arraybuffer
type. What my main question is there any of knowing what is the mime type of the file from the arraybuffer
as I need to convert it to BLOB
to view the file.
var file1 = new Blob([response], { type: file.type });
var fileURL = URL.createObjectURL(file1);
In the above code snippet, the response
is an arraybuffer
and the mime type I got is by storing it while uploading in a variable. But now the scenario is I don't have any mime type in my hand so I need a way to get it.
And this is my response body sample:
Can anyone suggest me anything ?