0

Given a tag with src to a blob representing an image, how can I know its format/file type? (png,jpg and so on)

Assuming the src itself doesn't contain any file extension that can help with that.

YardenST
  • 5,119
  • 2
  • 33
  • 54
  • 1
    https://stackoverflow.com/questions/18299806/how-to-check-file-mime-type-with-javascript-before-upload/29672957#29672957 – Teemu Jan 22 '21 at 12:09
  • Have you tried blob.type? This should return the MIME type of the image. If it is unknown then you will get back an empty string. – lortschi Jan 22 '21 at 12:20

0 Answers0