I am using angular 7 and need to upload image and send it to server to put it in database. So i wondering how to convert image into string and latter back in image so i can display it in app?
Asked
Active
Viewed 439 times
-2
-
https://stackoverflow.com/questions/52396524/convert-image-to-string-with-angular – MBer Jun 12 '19 at 00:55
-
1Possible duplicate of [convert image to string with Angular](https://stackoverflow.com/questions/52396524/convert-image-to-string-with-angular) – Creos Jun 12 '19 at 01:57
1 Answers
0
This SO answer explains how to convert an image into base64 encoded data.
You can use the HTML5 for it:
Create a canvas, load your image into it and then use toDataURL() to get the base64 representation (actually, it's a data: URL but it contains the base64-encoded image).
I don't think that's how you want to save your images though. Continue researching perhaps.

Ben Racicot
- 5,332
- 12
- 66
- 130