Passing data to Google Storage API
Options
I am trying to replicate this particular cURL request in Xano:
curl -X POST --data-binary @OBJECT_LOCATION \ -H "Authorization: Bearer OAUTH2_TOKEN" \ -H "Content-Type: OBJECT_CONTENT_TYPE" \ "https://storage.googleapis.com/upload/storage/v1/b/BUCKET_NAME/o?uploadType=media&name=OBJECT_NAME"as described in the Google Cloud Storage API documentation here: https://cloud.google.com/storage/docs/uploading-objects
I am able to replicate everything except the actual passing of the data (the --data-binary @OBJECT_LOCATION part).
First off, I don't know where I am actually supposed to define this parameter:
[Screen Shot 2021-11-16 at 12.38.09 PM.png]
You can see that I tried setting "data-binary" as a param, but this is almost certainly wrong.
Second, the @OBJECT_LOCATION parameter is actually the local location of the file on my computer, so this probably wouldn't work anyway since Xano.
In reality, the file that I am trying to pass to Google Cloud Storage is downloadable from a url. My goal is to write a script that hits the url, gets the file, and then uploads it to Google Storage. I'm not sure if this is even doable from Xano - maybe I just have to write a script to do this - but I figure I'd ask.
curl -X POST --data-binary @OBJECT_LOCATION \ -H "Authorization: Bearer OAUTH2_TOKEN" \ -H "Content-Type: OBJECT_CONTENT_TYPE" \ "https://storage.googleapis.com/upload/storage/v1/b/BUCKET_NAME/o?uploadType=media&name=OBJECT_NAME"as described in the Google Cloud Storage API documentation here: https://cloud.google.com/storage/docs/uploading-objects
I am able to replicate everything except the actual passing of the data (the --data-binary @OBJECT_LOCATION part).
First off, I don't know where I am actually supposed to define this parameter:
[Screen Shot 2021-11-16 at 12.38.09 PM.png]
You can see that I tried setting "data-binary" as a param, but this is almost certainly wrong.
Second, the @OBJECT_LOCATION parameter is actually the local location of the file on my computer, so this probably wouldn't work anyway since Xano.
In reality, the file that I am trying to pass to Google Cloud Storage is downloadable from a url. My goal is to write a script that hits the url, gets the file, and then uploads it to Google Storage. I'm not sure if this is even doable from Xano - maybe I just have to write a script to do this - but I figure I'd ask.
Comments
-
You're not going to be able to pass a file from your local like that. I suggest attending an upcoming office hours
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback