POST a file object to API?

Currently when I use File Uploader, I store as file. When I call file’s value, I am returned a URL (something S3 format?). My API takes in two texts and one file. I am having trouble passing my file as a file because Bubble seems to convert it into a link / URL??? How would I fix this? Basically, I want to POST a file to my API but it doesn’t work because my file object in Bubble returns a URL link not a file. Please Help! Stuck hard on this one.

1 Like

Can you share how you have configured the API endpoint in API Connector?
If you have set Form Data and select a parameter to be a file, it should work.

You need to switch to FORM-DATA in body type field and use “Add parameter”. You will have a checkbox “file” that you need to click

will it still work with my other variables in my json?

is this right???

Seem fine. This is easy to work this way.
You just need to be sure that endpoint will accept form-data

End point is just like making sure the API accepts form data right? So that would be on the API’s end, not mine?

Yes. This is the url you are calling. This url need to accept form-data

This topic was automatically closed after 70 days. New replies are no longer allowed.