Upload of buffer to Google Storage creates File with no buffer data #122
-
I am attempting to write a data buffer to a Google Storage Bucket using the CloudStorage/Async/NoCallback/Upload example as a starting point. Rather than pass a file from a FS, I am using BlobConfig to upload a test buffer. I plan on passing ASCII text and binary data in the future, that will be uploaded on ~30mins intervals. FirebaseClient appears to connect and I can see the the correct filename created in the Cloud Storage dashboard. However, the file does not contain the buffer data, but rather this data when the file is downloaded via the Cloud Storage dashboard:
I suspect there is something simple I am missing either in FirebaseClient or in the way Google Could Storage works, as it is my first time using these. Here is the code modified from the CloudStorage/Async/NoCallback/Upload example: As Globals:
The main Loop():
Here is the console output:
Thanks for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 14 replies
-
You cannot choose the resumable upload for small files or data. It should be 256k up as the Google Cloud Storage API document stated You should choose a simple upload type for small file instead. |
Beta Was this translation helpful? Give feedback.
-
@mobizt Thank you, I missed that. After changing to GoogleCloudStorage::upload_type_simple, I receive the return message but no file is actually uploaded. Not even the empty filename I received previously. Here is the message:
I tweaked the code to print the Result message after the upload is called:
Is the -1% and no URL indicative of the upload not actually happening? |
Beta Was this translation helpful? Give feedback.
-
It's a bug and thanks for reporting this. Now you can update the library to latest v1.3.7 with bugs fixed. |
Beta Was this translation helpful? Give feedback.
-
@mobizt Thank you for the quick update. I have updated to 1.37, however I now receive a file error (I assume passing the Blob) that was not observed in the prior build: The code:
The serial output:
I assume it is possible there was always a Blob issue, it had just not gotten to that entry point yet. |
Beta Was this translation helpful? Give feedback.
You should get the compilation error instead when you remove
ENABLE_FS
macro.If you don't get the compilation error, your Arduino IDE is actually used the pre-compiled (cached) library.
The library was updated with the issue fixed, please try.