Combining the FilePicker & GCS file upload

Hi Team!
I’m trying to make sense of the FileUploader widget. If I understand everything correctly, once a file has been selected, its data is stored in the filepicker1.data object –
it stands to reason that with the GCS resource, I should be able to upload data to my Google Cloud Bucket, no? However, whenever I try to connect the two: i.e. a filepicker that looks like this:



Notably, i use {{filepicker1.file.data}} which is however immediately marked as invalid JS. And sure enough, when running the query (to GCS) I get this error message:
Query Error (uploadFile): undefined is not an object (evaluating ‘t.error’)
So my question is a) can i use the filepicker together with GCS’s upload data action and if so b) how do I achieve this… I also tried filepicker1.file instead of filepicker1.file.data but to no avail…
Thanks!

Addendum: I tried following https://retool.com/docs/google-cloud-storage-integration but that didn’t work either…

so specifically, that’s what my query looks like right now. Lifted straight from the tutorial here: https://retool.com/docs/google-cloud-storage-integration giving the familiar error:
“undefined is not an object (evaluating ‘t.error’)”

so specifically, that’s what my query looks like right now. Lifted straight from the tutorial here: https://retool.com/docs/google-cloud-storage-integration giving the familiar error:

Bump

I also need this and would like to know how to do it

Hi @zach-7,
I ended up doing a somewhat sloppy solution. Instead of directly interacting with the GCS bucket, I ended up clobbering together a cloud function that is accessed via HTTPS POST and send the data as binary to this endpoint. Together with a bit of js, i can safely transfer data to GCS then.

I meant to write this up when I noticed the documentation was off. My working solution uses a JS query to trigger the GCP upload.
I send up the filename that I want to set (I use a slug and other info to rename it for our use).
I thn use filepicker.file.data to set for GCP to upload data. The docs read to use filepicker.file, which didn’t work for me.

So in the GCP script:
Upload file name is the file name I am setting for that file in the bucket
upload data is the filepicker.file.data stream.

I hope that is clear if not perhaps I can clarify more

One bug which still remains is the “Export file type” field. It doesn’t quite work as expected and limits the Content-Type values which can be set on the file. The conversation is here: Oh CORS 😕, GCS and cors issue by Export File Type