105
Views
2
Comments
Solved
Get Mime type of Base64
Application Type
Traditional Web

I need to preview the Binary File, I can able to view only Pdf type Binary other than binary am getting Error "Failed to load content" in Browser as the Mime type is given as application/pdf but i don't know the mime type of Binary where the binary is from Base64, so is there any way to get Mime type of Base64.

I am getting that error when the base64 type is Png or Jpg.

2024-12-10 04-40-04
Gitansh Anand
Solution

Hi @sasikumar S, Please look at this stackoverflow post and see if it helps,

https://stackoverflow.com/questions/57976898/how-to-get-mime-type-from-base-64-string

According to this base64 for
1. PDF starts with "JVBERi0".
2. PNG starts with "iVBORw0KGgo".
3. JPG starts with "/9j/".

Thanks
Gitansh Anand

UserImage.jpg
SASIKUMAR S

Hi @Gitansh Anand  

Thanks for replying .

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.