Complete file not uploading to google drive from retool

Hello everyone, I am building a very simple app

  1. The app just uploads a file to google drive with a custom name that is generated dynamically based on the options selected by the user.
  2. I have configured the google drive REST API and it is working properly. The issue is when uploading file to google drive. Via a dropzone component.
  3. The uploaded file is showing 0kb in the drive itself, this means there is some issue in uploading.
  4. I tried simple and multipart upload both no luck. Google's stupid documentation does not tell anything nor it gives examples.
  5. Basically, what I want to achieve is upload a complete file to google drive in a specific folder, whose ID I have. and give it a custom name.
  6. I have seen tutorials from sites like boldtech but they just upload text content not actual files from the system.
  7. Any guide on how to do this is appreciated. Thank you.

Nevermind. Turns out it is a serious bug in retool, where file is not at all uploaded at all to drive if you upload it, turns out there is some issue in how it handles file upload. Switched to a native react web application and it works fine now.

1 Like

Hey @SHC! Welcome to the community and thanks for reaching out! :slightly_smiling_face:

What kind of file are you trying to upload and how have you configured the request? I agree that Google's documentation for the HTTP REST API is a bit lacking, but I played around with it for a bit and got it to work.

For me, it worked best to configure a multipart request and to format the RAW body manually.

No worries if you have a functional workaround and are happy with that, but this setup should hopefully work for your use case!

Hey @Darren and @SHC

I am having myself a problem with G Drive API.
I tried various ways and just tested the solution you proposed.
I still get "Unsupported content with type: application/octet-stream"
No matter what I see the body in request being wrapped in " " and I can't send it as an object, it's always a string.

Hi @zupa_dnia! Welcome to the community. :slightly_smiling_face:

Depending on where you're inspecting the body of the request, I actually expect it to be formatted as a string - especially if you're doing a multipart upload. Can you share the configuration that isn't working for you?