How to upload a file to Google Cloud Storage?

Hi,

I've been trying to upload an image GCS. When I run the query, there's no errors but I cannot see any new images in GCS console.

I created an GCS resource and used it like below:

I haven't configured the CORS feature for Retool, because I don't know how to do this. I think my problem came from here.

Also, I want to take the public link of the file that I uploaded. How can I do this? fileDropZone component does not work offer this.

Thanks,

Hey @can!

If you can install gsutil that can be a good way to manage your CORS configuration as documented here. Otherwise, I'd recommend using Google's OAuth 2 playground to access their REST API and manage your CORS settings that way (more docs!)

Typically, though, if you're running into a CORS error that should be visible in your browser console if it's not showing up in Retool. That's a good place to check but, as you mentioned, if you haven't set up CORS for your bucket it's likely something you'll need to do either way.

Is there any particular part of the setup process that you're having trouble with?

I would check that the service account you created has bucket level permissions. I got to the same point and that was my blocker.

CORS has to be configured for this else it won't upload

1 Like