I love Bubble, but it seems there are some limitations when it comes to sending files via API.
There is the checkbox “Send file” with the body type “form-data”, but it’s not compatible with all APIs. For example, this is the case if you try to import videos on YouTube.
I noticed that other Bubblers have encountered the same limitation on the forum:
Use AWS Lambda to run a script (support Node.js, Python or Ruby). The script should download the file from the Bubble storage URL, temporarily store it on your AWS Lambda, and then perform an API request to the upload endpoint.
If like me you don’t know how to code, ChatGPT is quite effective for writing small scripts. Just be careful with the AWS Lambda function timeout, you can increase it if you are dealing with large files like videos.
You can then trigger your function AWS Lambda from your Bubble application using the API Connector.
sounds like something that could be solved quite easily using a custom plugin. having the AWS path is just an overkill and expensive…
we have a plugin that should be distributed in a few days for uploading files to S3.R2 , etc , whew one option is using the binary data as input
Custom plugin can be a solution for small files, but with videos you can easily reach the Bubble memory limit for server-side action (125mb). That’s why i ended using external service to have full control over memory / timeout settings.
I’m building a video scheduler for social networks. The user uploads the video to my database with the publication date (client-side). Then, it is up to me to send his video to the social network at the right time (server-side).
sorry , this sounds like a very bad “workaround” for a problem that has nothing to do with the issue in topic. that’s pretty much using AWS lambda as worker for overcoming a server side action which could have been avoided by implementing better principles of sending it to an external object store , also leveraging binary input. then using that store as link for the scheduled upload. AWS worker has time limitation , and given your considerations , it’s unlikely to be safe, plus I believe the implementation can’t guarantee checksum , meaning it’s not reliable
I’m just sharing the solution that worked for me. I don’t have advanced coding skills, it seemed like a good solution to me. If there is a better solution to this problem, I’ll be the first to implement it. Maybe you can share it with us.
One of the problems is that you can’t publish to YouTube with a link, the video must be hosted on the server that makes the request. I’m going to rename the topic, because the problem seems more specific to YouTube API.
I suspect it’s a CORS issue , not a third party URL , and needs to be handled like any CORS constraint. guessing that by making the AWS lambda have the same origin as the temp data made the process work. I haven’t looked into it , but I’d probably look at using a backend service like Make , or make my own endpoint using python backend to achieve this. not everything should be done on Bubble just because it has scheduled workflows…
I have set up TikTok API, you can just send the URL of the video and TikTok will fetch it (PULL_FROM_URL method, see documentation). The problem with TikTok is that the file must be hosted on a domain name that you own, so you can’t just share the file link provided by Bubble. I’m still looking for the best solution for this problem. Maybe it can work with a redirect on a CDN like Cloudflare, I have to try
you’ve found a legitimate solution to your problem. Might I propose an improved solution. You can create a client-side plugin action in bubble.io and send the file via client-side API call. You’d have to generate tokens on the server side to do this securely, but your WU cost will be significantly reduced and this solution is much easier to maintain than using AWS Lambda.
Note: My suggestion to you and others who are relying on chat GPT to write scripts for you (that you are unable to decipher yourself) is to avoid doing that because if there is an error that creeps up in the future, finding the solution will be very complicated for you.
Thanks, but I don’t understand how you can publish a video client-side if the user is not connected at the time the video needs to be published. Social media APIs don’t allow scheduling, you have to import and publish directly. The only way to do it when the user is logged out is server-side, right?
Let’s say that ChatGPT is a good compromise in this situation, when you can’t do it without code and you don’t know how to code
Can’t you upload it directly and then schedule a premier? I know that’s not a solution for every use case, but its viable. I recommend this if possible since it will lead to a more robust platform