How to get MIME-TYPE from Base 64 String?

I am getting base64 for string from backend and i am then decoding it in Javascript to show on browser. This string can be any file .pdf, .img, .docx, .zip etc. My base64 string does not includ...