Image picker how to limit image size on upload?

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

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

1 Like

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

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.

1 Like

@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