I need to upload a file to cloudconvert.com API service to be converted. I have not idea how to perform this in bubble, but I have great success in postman Binary.
Any idea how I can perform this?
P.S. I know I can provide an URL for cloudcovert so it can fetch the file itself, but the problem all of the files uploaded are private.
Have the same exact issue with the WRIKE API. Have to send attachments through ââdata-binaryâ⌠No solutions in Bubble. And ârawâ is not acceptable. I tried everything! I base 64 encoded the image and sent it - To no avail.
Fairly big limitation in the Bubble API Connector.
We have the same issue now with one of the APIs that requires the file to be sent in binary via POST.
Itâs currently not clear how to send the binary payload via the API connector.
Any advice or assistance from the team, please? @emmanuel
Weâve tried a lot of things, but none were successful so far.
Thanks, @w.fly, but as best I can tell, that wonât work in my case. Googleâs API endpoint expects the raw image data, which is all I have. I donât have a URL pointing to an image file.
You can run this JS with the toolbox plugin, worked for me!
const remoteFileUrl = âxxx.com/....pdfâ; // Replace with the URL of the remote file
const signedUploadUrl = âendpointtoupload.com/uploadâ; // Replace with your actual signed upload URL
// Step 1: Download the file from the remote URL
fetch(remoteFileUrl)
.then((response) => {
if (!response.ok) {
throw new Error(âFailed to download fileâ);
}
return response.blob(); // Get the downloaded file as a Blob
})
.then((blob) => {
// Step 2: Upload the downloaded file
fetch(signedUploadUrl, {
method: âPUTâ,
body: blob,
})
.then((uploadResponse) => {
if (!uploadResponse.ok) {
throw new Error(âUpload failedâ);
}
console.log(âFile uploaded successfullyâ);
})
.catch((uploadError) => {
console.error(âError uploading file:â, uploadError);
});
})
.catch((error) => {
console.error(âError downloading file:â, error);
});