1

I need to use javascript to create an image file on my local computer a .png or .jpg etc file, I have the base 64 of the image, can this be done?

1

2 Answers 2

3

Yes you can do it. All you need is:

var img = new Image();
img.src = 'data:image/gif;base64,...';
document.body.appendChild(img);
Sign up to request clarification or add additional context in comments.

Comments

0

In Nodejs, create a buffer with base64 encoding and write the buffer to the file

refer - https://stackoverflow.com/a/6933413/4325568

1 Comment

Unfortuanately I am using react-native which doesnt support Node.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.