I am new to Anvil and I must be missing something fundamental. After almost 2 days on this, I don’t know what else to try.
I need to send a URL of an audio file to an external endpoint. I can use a URLs of a public file of different formats (wav, mp4) and thy work properly. So, everything is working except for being able to create a URL of a file I create client side and sending it to the endpoint. I am getting a response of 400, malformed / bad request.
On the client side I have two variables returned, one for audio content and one for uri.
audio = anvil.js.to_media(self.recording,content_type='audio/wav')
self.uri = js.window.URL.createObjectURL(self.recording)
self.uri address is different than creating a Blob from the audio. In the same pass I get:
self.uri:
blob:https://yks3o2kwribzm6cr.anvil.app/9e8152be-d815-4f0c-aa50-77b5902d9148
for the audio blob, using:
temp_url = anvil.media.TempUrl(audio)
blob_url = temp_url.url
blob:https://yks3o2kwribzm6cr.anvil.app/596c424d-b838-4714-8c62-3fb0465d9809
When I send either of these links to the server code to call the endpoint, with or without “blob:” I get response of 400.
On the server side I use the url that I pass from the client side. I read on a forum post that you need to open the file. If I try to open the link, then I get “No such file or directory.”
What I am missing?