0

Basically what the title says; I have a base64 string that encodes an image and I want to convert it into a blob so I can pass it into my File constructor. I realise many similar questions have been asked however many of the other answers make use of the atob function which has been deprecated; So im trying to look for alternatives.

aj soprano
  • 151
  • 1
  • 6
  • 1
    Does this answer your question? [Creating a BLOB from a Base64 string in JavaScript](https://stackoverflow.com/questions/16245767/creating-a-blob-from-a-base64-string-in-javascript) – jps Jun 06 '22 at 07:58

1 Answers1

0

Try this

var base64String = "dGVzdAo=";
var blob = new Blob([base64String], {type: 'text/plain'});
abhinav gajurel
  • 421
  • 5
  • 11