Fail to download or open base64 image

Hello, I upload a image in the table succefully.

But when I go to download it, it will fail.


I try to open it in new browser tab, it fail too.
image

Any help will thanksful.

Hey @AnsonHwang ,

interesting problem :)) could you share the whole base64 string? would love to do some testing

Hello, thanks.

/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABDADUDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwC1ocdodatH1JQbFWJl3AkHCnGQOSN2K777Z4G/59dP/wDAD/7CvO4f9UtdtPeWemnR7RtGsriK5soXkbyR5pZsg4b14rXMMbUqYmaeii7dejOrKskw1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+tGcoQh21/P7tz3cNlmHnTjUnU3TdvyNPE0aI1xBNB5mWiMsTJ5ij+Jc9R7ipXinjtTdSQTpbDGZmiYJyAR82McgjH1rn2u4YYBAkur3Fs1zdXs8s0SCQSOgCIBvYEBgCzHBOegxU+rXriPEE1/PqM+gWdsLZ4x9nQFY3Lbt2SeD8u3GSTntULMq0YRUoe8/8AL+vzNnlGHlUm41PdX4a2/wCD+Buxaff3HliK1nV5p4IYA9u+JBLuO8H+6oQkkA8VDIVW8uIFE48mTYfPgML590JOPz6Vmy6vbRX8t4i6xPJda1aanLDKibYRGWLIh3/MfmwCQuQACBijRYGgsiGBBeRmwRzgmtMHiMTVrv2itH/hv+CYY/CYShhk6TvLTX7/APgGlRSUV654YUvaiikA1xlCPUVT0+CKF5TGgXJ5xRRUSS5kaRb5Gi9R3ooqzMSiiigD/9k=

I found the reason to cause this error - lacking of file type.
when I right click the image to open it in chrome, the address bar show "data:image/;base64,/9j/4AAQSkZJRgABAQEAYABgA ..."

When I add image type jpeg to it, it will work right.
"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgA ..."

should retool auto set the file type? or make it configurable to developer in table column or some place?

Hey @AnsonHwang, This appears to be a bug with the download on our Image Upload column type. Thanks for flagging this for us and for sharing the issue you've identified! I've passed along a report of this to our engineers and, while I'm unable to give you an ETA for a fix at the moment, I'll post updates on this bug here.

Until we're able to resolve this issue, would you be able to download files from the table in a JS query using the utils.downloadFile() function?

How you pass the file to this function will depend on the workflow you want to build. Here's an example where I've set the Sales column to the column type 'Image Upload'. I've set a button to run my JS query named downloadFile to download the image file from the selected row in the table.

Since this image is a base64 encoded file, I needed to use this specific syntax

utils.downloadFile({base64Binary: BASE64_STRING} , fileName, fileType)

I hope something similar to this example could work for you until we can fix this bug!

Hey @AnsonHwang, I'm just reaching out to let you know that this bug has been fixed!

Hey @everett_smith, how can I get the name of the image file in the table "Image Upload" column?

Hey @retool_taleemabad!

Unfortunately, it looks like this gets lost during the upload at the moment. I've let the dev team know, and in the meantime I'm curious to hear more about your use case!

1 Like