Google Cloud file upload problem

Hi there -

I'm trying to use a file upload component to upload to GCS.
I've been reading a lot of examples and also this thread : Combining the FilePicker & GCS file upload

which all refer to a {{filepicker.data}} value.

I don't seem to be able to access that, and am getting a recurrent "null is not an object (evaluating 't.file')" error when I try to upload.

Could anyone advise as to how to achieve this? I'd really appreciate it!

Hi there!
Can you share some more details of what you are trying to do? What type of upload are we talking about? CSV? Binary?

Apologies - of course!

I'm trying to upload a jpeg binary.
I can retrieve it fine into an image object using

{{ "data:image/jpeg;base64," + getIMG.data.body }}

but I can't figure out how to upload...

In particular, in the documentation here : Google Cloud Storage Integration

it refers to a {{filepicker.file}} property, but I don't seem to have that available at all...

Have a look at this screenshot


NOTE that the filepicker1 is added in its entirety in the Upload data part of the form.

Hope this helps!

Hey there - thanks for the message :slight_smile:
hmmmm - I'm still getting the same error...
This should also work for filedropzone component too, yes?

I note I don't actually have a 'filepicker' component available, just button/ Dropzone/ input..

@mrsimons

Hey there! This is happening because the structures of the newer file upload components are different from the deprecated versions (filepicker). We have a bug report for this, I just linked it to this conversation so that when progress is made I can update you! For now, I would either use the deprecated version, or restructure your data.

Here is an example of how to restructure the data. First, a visual example of how to upload with filepicker:

Now with the newer version:

If you want to loop through multiple files, I would replace [0] with [i] and trigger it with a JSQuery. Hope this helps!

Thank you for the update. This is now starting to work, although I am running into a related problem (or at least I think it is related):

While I am now able to upload files to GCS, GCS does not seem to recognize the filetype. The filename is correct (example.jpg) but GCS does not list the file as being a jpg under the 'type' column.

This is relevant as I am exclusively hosting image files. Now when I click on the file link, example.jpg just downloads as opposed to showing up on the page.

BTW, I am new to both this system and to GCS, so my apologies in advance if I'm missing something obvious.

Thank you for any guidance you may be able to provide.

Hi @andered! What file link are you referring to?

I was able to upload this test image to GCS and display it in Retool using the mediaLink property

Thanks for the response. I am new to this, and have to remember to check in now and then!

I did not know "mediaLink" was an option. I will try this out.

What I had meant with that I can upload files to GCS just fine. But when I look in GCS, the uploaded file is not identified as being a .png. The "type" column field is just blank. Files that I upload to GCS are identified properly. Then if I click on my "blank" file's URL, the file itself downloads. If I click on the other, properly identified, files then I just see the image in my browser. The downloaded file looks just fine when I open it. I assume the failure to register the filetype is related to the downloading, but I am not sure.

That was very long-winded. I will see if the "mediaLink" thing works.

BTW, the AWS S3 uploader works perfectly, so I am using S3 right now. I'd prefer to keep everything on GCS, so I will keep at this.

Thanks!