Uploading a file as binary

its been noted as a “gap” in bubble approach to support of PAAS style FILE API
re: file store in bubble DB . IMO the docs on files in bubble are kinda unique and it is not clear when bubble actually stores the files ( bytes ) and when it stores only a string value to be used to GET or FETCH the file ( a url ).

if its the former then its not clear how to get the files bytes as you would in JS ( file or blob ref ) and you need the proper ref & type to file ( blob or dataArray or nodeStream) before you can call your API expecting a binary as the POST.body…

obviously , with the the url, you can fetch the file in native JS and handle it as the type of your choice ( byteArray, blob, stream )

not a bubble expert , but if your binary endpoint is designed for simple JS Fetch.POST action where the binary is in the request body, then here is what id do…

with the URL allowing a GET from the bubble db, issue a GET to a private API that acts as a proxy to the API u mention.
The api route involves 2 steps

  • Fetch the url and use the Response.body (containing the binary files bytes) as the input side of a PIPE
  • PIPE the response directly to the POST to your api ie ( setting STDOUT from #1 to STDIN for #2 . independently supply headers for the step 2 post to your api and it will just work as seen here