Unable to upload filezone image to Google Cloud Storage


I've been trying for nearly 2 days straight to upload a file to google cloud storage. Unfortunately, the docs aren't too helpful. I can't figure out what the correct format is to upload files to GCS.

The file upload portion is working (see the second image), but the data appears to be corrupted or incorrectly parsed. All the photos come out blank. The file sizes are roughly correct, however.

Has anyone gotten this to work recently?

Connect to Google Cloud Storage

Correction. I added an intermediary query to first run atob on the encoded base64data from the image. Then I pass that to cloud storage. Still failing.

I actually am having an issue currently (I believe might be similar to you). Where the file uploads correctly but the storage size is 15B and there is nothing there. My file components previously made work. But my new ones for a new app are not working

Hey @PadenM are you also uploading to GCS?

Yes

@PadenM can you post a screenshot of your query? How is it being triggered? (i.e. on parse of file upload component)
It could be worth looking at your CORS configuration. Do you know if you included X-Goog-Acl in the responseHeader section?

@dzd, can you try removing atob() and passing {{petPhoto.value[0].base64Data}} directly?

@Tess So i should i responded to my own response earlier. My issue was i was putting in all the file data into the data section not just the base64Data. I fixed that and mine worked fine.

It was just my Error :sweat_smile:

1 Like

Np, glad to hear! that may end up being the solution for you too, @dzd

Hi folks, I ended up solving this, but now have a new issue. I'm getting blocked by CORS. I can run the Cors Unblock chrome extension (https://chromewebstore.google.com/detail/cors-unblock/lfhmikememgdcahcdlaciloancbhjino?hl=en&pli=1), and it solves my issue, but I can't use this pre-built Google Cloud Storage uploader until CORS issues are resolved. Any advice?

:thinking: Can you share your CORS config?

I know a teammate of mine just recently set up their GCS resource and found that they needed to add X-Goog-Acl in the responseHeader.

Just to clarify, is this a config in retool? Or in GCS itself?

Yes, in GCS (not on the Retool side)