# \[Solved\] how do I base64 encode an image?

**URL:** <https://community.thunkable.com/t/solved-how-do-i-base64-encode-an-image/1858457>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, base64\
**Created:** [May 2, 2022, 2:31pm UTC](https://community.thunkable.com/t/solved-how-do-i-base64-encode-an-image/1858457 "2022-05-02T14:31:31Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 4, 2022, 4:31pm UTC](https://community.thunkable.com/t/solved-how-do-i-base64-encode-an-image/1858457/21 "2022-05-04T16:31:03Z")

</div>

The last one is easy. An image from `Canvas` is already in Base64 format. You just need to use this block  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/9/a94388f3b677065d5441a8101e3b0635e23fa74c.png)

The other two requires either AJAX or Node.js libraries if needed as independent extensions but the `image from photo library` and `image from camera` are already supported by my `Web Viewer` so practically it is all supported.

See this screenshot

 ![Screenshot_2022-05-04-19-31-17-07_c31b32364ce19ca8fcd150a417ecce58](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/b/3bd92313e0d80594ede3dabd37808120f0101e2d.jpeg)

Once you click on the `Choose File` button you are prompted to select between camera or files in your mobile.

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [May 4, 2022, 4:37pm UTC](https://community.thunkable.com/t/solved-how-do-i-base64-encode-an-image/1858457/22 "2022-05-04T16:37:29Z")

</div>

To save the image of Canvas in Google Drive see my demo  
[https://x.thunkable.com/projectPage/618cfa678cdb0f0011998dbe](https://x.thunkable.com/projectPage/618cfa678cdb0f0011998dbe)

and this is the tutorial for it

> [@Save Canvas Image to your Google drive](https://community.thunkable.com/t/save-canvas-image-to-your-google-drive/1609950):
>
> For this tutorial you will need to code a short script in Google Apps Script which you can access it from within Google Drive. You will need to use Web API component to talk to the script you created in Google Apps Script and pass the parameters using the Query Parameter section the the Body section. The Base64 image cannot fit into the Query Parameter section and therefore will will need to pass it using the Body section of the Web API. The Thunkable project is very simple and is used to demo…

---

<div class="post-metadata">

**Author:** ![stephane\_golonkaa71](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@stephane\_golonkaa71](https://community.thunkable.com/u/stephane_golonkaa71)\
**Post date:** [May 4, 2022, 4:45pm UTC](https://community.thunkable.com/t/solved-how-do-i-base64-encode-an-image/1858457/23 "2022-05-04T16:45:05Z")

</div>

I already saw your demo, but when image of canvas is resize, image is no more in base64 format. For the two other point I don’t want to click on button on web\_viewer

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [August 2, 2022, 4:45pm UTC](https://community.thunkable.com/t/solved-how-do-i-base64-encode-an-image/1858457/24 "2022-08-02T16:45:15Z")

</div>

Closed on August 2, 2022, 4:45pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://community.thunkable.com/t/solved-how-do-i-base64-encode-an-image/1858457.md?page=1)
