Image upload issues on mobile app

Hi everyone.

I'm building a mobile app. Users should be able to take or upload as many pictures as they want and these images should be saved into Retool Storage. Offline mode is also required. I run into a couple of issues:

  1. The app crashes when I try to upload more than 30 pictures simultaneously.
  2. When I try to upload images in offline mode I receive an error 'no internet connection'.

So my questions are:

  1. Is it possible to upload 30+ photos at once using retool? How do I handle the crash on my side? Please take a look at the image uploader component config.
  2. Does image upload work in offline mode? If yes how do I configure it? I have already set up the Offline attribute for all queries in the Advanced settings tab.

If there is anything else I can provide you with to make the problem more clear - just let me know.

Thanks in advance!

1 Like

Hi @Aleksandr_Tynianov, welcome to the forum! :wave:

Great questions! Let's start with the first one,

The short answer is yes, we can upload more than 30 pictures.
To test this, use the "Go to app" button on your computer and test it on the browser.

I tested 40 photos and they uploaded with no issues on my Mac. But there might be external limitations from the device we are using the App on. I had the same experience as you with my iPhone 12 pro max. I talked to our Mobile developers and I got some context.

The crash may be related to memory limitations on the device:

  • When selecting photos to upload, data will be duplicated many times to render it, upload it, etc.
  • 40 images, at 4MB per image is about 160MB to store them once. When they get duplicated multiple times, we are looking at 1GB+ extra memory. This may be causing the App to crash.

What I recommend as a workaround to avoid this issue is to use multiple "Image Input" components, perhaps we could use four different ones, and allow 10 images per input. I know this may not be the cleanest from a UX perspective, but it can unblock us for current issue.

On the other hand, all uploads should work in offline mode, the requests just get queued up. However, to make the upload work on mobile for multiple images, we are not running a manual query we can set the offline mode in advanced options. We rely on the built-in query from the "Image Input" component that is enabled when we select "Upload file to Retool Storage" on the "Interaction" options:

This one we cannot manually add offline mode settings to. A request has been made internally to upgrade our mobile components so they are able to handle this in offline mode. I'll be happy to update you with any news from our Engineering Team.

I'm guessing for your use case, the photos are taken and uploaded inside of a warehouse where there is no internet connection. Could you give us a bit more context for your use case? This will help us come up with the best workaround until the feature is created. Perhaps your users could hold on to the photos on their camera roll and upload them as soon as they get internet connection, but can create delays in your operations.


Hi Paulo, thank you

Aleksander and I are working together on the same project, so I can respond to your questions

Understood on your 4 x image upload selectors

On the second part I wasnt quite sure what you meant. I think there are some words missing: 'However, to make the upload work on mobile for multiple images, we are not running a manual query we can set the offline mode in advanced options'

If I understand your point, its that image upload does not working offline yet, but that its in progress?

Your assumption is correct, our users operate often without internet and need to queue up images to upload while not connected. We currently do the camera roll as you said, but the point of looking into re-tool was to get around this. It appears that Retool is not able to satisfy our use case here?

Hi @CGL, sorry about the confusion, let me reword that:
When we manually create resource queries, we can go into advanced and add settings for offline mode:

However, using the "Image Input" component, we rely on a built-in query that is enabled when the following setting is selected:

We can't change the settings on that one, and offline mode is not supported there yet. Our engineers recognize that this feature is needed, and are currently working on it, but there is not a release date yet. We'll be happy to update you on this thread when it's the case. As of today, we cannot satisfy your use case.

Hi @Paulo, I used to upload images using a S3 resource. But its much faster with the built-in functionality 'Upload file to Retool Storage', the only problem its that apparently this function its not enabled for Offline Mode. +1 to that functionality!

Hi @pedrowach, thank you for bringing this up. One alternative for the use case above could be creating an S3 resource and adding advanced settings for offline mode. But the trade off is that, as you mentioned, it is significantly slower. I just added your +1 to the FR!

1 Like

@Paulo thanks for your replies, quite helpful

1 Like