# Image picker how to limit image size on upload?

**URL:** <https://forum.adalo.com/t/image-picker-how-to-limit-image-size-on-upload/31687>\
**Category:** Database\
**Created:** [September 9, 2022, 12:24pm UTC](https://forum.adalo.com/t/image-picker-how-to-limit-image-size-on-upload/31687 "2022-09-09T12:24:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TonyS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tonys/32/23681_2.png) [@TonyS](https://forum.adalo.com/u/TonyS)\
**Post date:** [September 9, 2022, 12:24pm UTC](https://forum.adalo.com/t/image-picker-how-to-limit-image-size-on-upload/31687/1 "2022-09-09T12:24:56Z")

</div>

what should be done ? so that I could set the maximum upload parameter for 1 photo to 10 mb?

---

<div class="post-metadata">

**Author:** ![TonyS](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/tonys/32/23681_2.png) [@TonyS](https://forum.adalo.com/u/TonyS)\
**Post date:** [September 9, 2022, 12:25pm UTC](https://forum.adalo.com/t/image-picker-how-to-limit-image-size-on-upload/31687/2 "2022-09-09T12:25:40Z")

</div>

@Flawless hello, I consider you a great connoisseur, do you know how to do this?

---

<div class="post-metadata">

**Author:** ![Flawless](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/flawless/32/20131_2.png) [@Flawless](https://forum.adalo.com/u/Flawless)\
**Post date:** [September 9, 2022, 12:32pm UTC](https://forum.adalo.com/t/image-picker-how-to-limit-image-size-on-upload/31687/3 "2022-09-09T12:32:55Z")

</div>

Hey Tony, it’s possible to compress images when users upload them, but you’ll need to use an API for this, something like TinyPNG. Then, you’ll need to use a “Text” parameter to store the image in the database, not an image parameter, as you’ll need to store a new URL for the uploaded image.

Here’s the TinyPNG dev docs: [TinyPNG – Developer API](https://tinypng.com/developers)

On your button, add a new custom action with a POST request that contains the image and the return value will give you a URL of the compressed image.

---

<div class="post-metadata">

**Author:** ![Rozza](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/rozza/32/22780_2.png) [@Rozza](https://forum.adalo.com/u/Rozza)\
**Post date:** [September 9, 2022, 1:31pm UTC](https://forum.adalo.com/t/image-picker-how-to-limit-image-size-on-upload/31687/4 "2022-09-09T13:31:25Z")

</div>

@TonyS  
You can’t do this on the device before upload, the full image size is uploaded, then any compression is done server side.

The image picker needs a complete overhaul IMO, see this thread where Victor and I hash out some inner workings

> [@Slow performance in Asia and with photos generally](https://forum.adalo.com/t/slow-performance-in-asia-and-with-photos-generally/31196/2):
>
> On closer inspection… During the process of the component Image Picker it appears to go black when the image is uploaded, then flash reloads with the same image. I believe what is happening is the image is uploaded, then the same image is served from imgix, now compressed. So I am uploading a 2MB photo, to then immediately download a 600KB copy of the same photo. Can anybody on the forum confirm the same? I think this might be something that @Victor has experience in.
