Created
October 16, 2022 13:05
-
-
Save atakde/637173ebc223beff8a6e0b575788c957 to your computer and use it in GitHub Desktop.
Convert to base 64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const handleImageUpload = (e: any) => { | |
| const file = e.target.files[0]; | |
| const reader = new FileReader(); | |
| reader.readAsDataURL(file); | |
| reader.onloadend = () => { | |
| console.log(reader.result); | |
| // make request to your backend | |
| }; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment