I'm trying to upload to Google Drive (can't use Retool storage as recordings surpass the 45mb limit for retool storage) a recording from a mobile app using the recording component.
However, differently to the web app component, the base64 info is not exposed. I've tried extracting it from the blob url without success. Any way I could do this?
What have you've done to extract it from the blob url? The following code snippet within a JS script should work: return utils.getDataByObjectURL(microphone2.value)
On native devices, it should output a string that looks like
Oh wow, as simple as that... I tried fetching the blob from the URI and passing the blob to the fileReader.... not sure what other things Chatgpt suggested.... Great to get to know this utils. function.
Thanks for getting me back so quickly, really appreciate it!
I have a microphone component in retool mobile app, from which I get the base64 as per your solution to then upload it to google drive via API.
However, every time I try to open it in google drive it can't play and it would seem corrupted. So I tried pasting the base64, both from the base64 I get from the microphone component and my google drive file (which they match) and put it into a base64 to a decoder, from which I get
Strangely the mime type appears as video/webm and this seems to be messing with google drive not being able to play it (the decoder does play it properly).
What's confusing me is that the microphone1. info says it is type "audio/webm" but this seems to be overridden by the base64 info. Does this sound accurate? Is this how it is supposed to be?
Sorry about that! Right now utils.getDataByObjectURL uses the default application/octet-stream binary data type. We'll upload a patch to fix this later this month, but in the meantime you should be able to check if your base64 string has application/octet-stream, and if it does, replace it with an audio type e.g.:
I got it to work with the following configuration. Note that I constructed the multipart body manually and, importantly, specified the audio codecs in the Content-Type header.
Thanks @Darren, I've now been able to upload it properly. I ended up constructing the multipart body manually as well, something may have been not completely right with my transformer.
Really appreciate your help with this! This delayed my project timeline by 2 weeks but I'm glad to be able to move forward with this.