Handling/Storing of Images Uploaded to Retool


I am trying to create an app that would handle work orders, and associated with those work orders would be images. Using an image upload component that returns the base64 string, I tried a few methods and all of them seem to have major issues stopping me from implementing them.

The first method was to create an API to connect to a Google Drive folder, which would then return the file ID that I can reference. I was able to successfully upload the image file, but I could not control the image name or file location, and the image file concatenated four lines that made the file unusable as seen in the image below. If I could rename the file and move it to a specified folder, then I could write a python script that would remove the first 4 lines of the file, which would then 'fix' the image. This method seems messy however.

The second solution was to just save it to my Postgres database. However, the image that I took on my phone had a file size of under 3 MB and returned the error 'Request Entity Too Large'. Turns out the base64 string length is nearly 4000000 characters. Note that I am using self-hosted Retool and at most a dozen images would be uploaded weekly, and we would contain the image library to a certain size if need be by deleting older records.

My group did explore the AmazonS3 and Google Cloud Project integration options, but our organization has limited our access to these.

Hi there,

Happy to help out here and thank you for the screenshots!

Looking into this, I was able to find a thread in our forum of someone else writing in about something similar here - more specifically the bold tech article.

Also, trying this on my end, I was able to achieve a similar goal by utilizing Google Sheets:

This allowed me to store the base64 string without issue.

Let me know if this works for you or if you have any additional questions!