0

I have base64 data of a file coming from API to react and need to read and download this file in it's actual form PDF , doc , .. or link the download action to a button

1 Answers1

0

Try this:

<a download="filename.png" href="data:image/png;base64,foo...">Download</a>
Vinicius Katata
  • 932
  • 3
  • 7
  • didn't work ,, just downloaded unknown file {the binary file itself} i want to get it back as pdf or whatever it's actual form was – Amr Mansour Apr 18 '21 at 17:38