I am having the same issue referenced in this post: Upload images to S3 from Mobile Input - #3 by Daniel_Weinstock
The issue only occurs when usign Retool Mobile from my iOS phone. The version I am running is Retool Mobile v3.183.0 Build 2132.
The Content-Type is not being set when doing an S3 Upload from my phone. I have tried deriving the content-type by extracting the details from the file and also hardcoding it. It is stripped when I inspect the image in the S3 bucket.
If I use the same app on my browser emulating mobile, it works fine.
Bumping - any help on this?
Hi @Jessica_D,
I can help you with this. Can you provide screenshots of the queries you use to upload your file data to your s3?
Thanks.
Thank you for your help.
I am using an Amazon S3 resource configured for my bucket, action > Upload data.
The upload works fine when running on a computer (either through the editor or phone emulator), but the content-type is blank when using my iOS phone.
I first thought it is because of the file type of iOS images being something that either S3 or Retool could not handle, so I also tried to hardcode "image/jpeg" in the S3 Content-Type field, but that still does not work. It is omitted on the uploaded S3 resource, but the rest of the contents are there.
One thing I noticed on this screenshot I just took, fileType.value has a value of "image/jpeg" but the little green window shows blank. But this does work as expected if I hit run.
@Jessica_D,
Are you using a regular file input or an image input? I had presumed that for mobile you are using an image input so you can use the camera?
Get your data from your image input (or file input) component like this:
(note that you have to use the utils.getDataByObjectURL function to get your base64 data.
and then upload your image to your s3 bucket:
I am trying to upload a photo from my iOS photo gallery (not from the files).
Using S3 Content-Type = Binary instead of taking it from the file itself seems to work, thank you.