Make File Private using workflow

Thanks Zubair for taking the time to reply, you’re awesome! All working now. Adding more here in case it helps someone else:

My mistakes were many:
a. was trying to use a wf/api url and not the fileupload url in the attached screenshot.
b. not ticking the capture response headers
c. trying to use an event, not using this call as an action

My use case: Have unattached .mp3 file in Bubble file storage returned from an external API and need to attach to a thing so that it is protected by privacy rules.

Version-test api settings:

Thing in Database:
B64 field, type text
MP3 field, type file
List of MP3 files, type files

Backend workflows:
a. Save MP3 to MP3 field
b. Save B64 to B64 field (MP3: encoded in base64)
c. Run the above call as an action with parameters:
name = [name].mp3
attach_to = [Thing unique id]
contents = [Thing B64]
d. Trigger Delete of B64 and MP3 fields
e. Add Result of Call’s body to List of MP3 Files

Cheers, J.

1 Like

We tried implementing the API to upload a file privately but somehow the URL of the new file is all broken…

Here is how we setup our API:

Then we did a workflow to take a public file from a database object, re-uploafile it privately, delete the old public file and re-link the new private file with the object.

  1. Upload the new file privately

  2. delete the old file

  3. Link the new file to our database object:
    image

However, in the end we get a URL in the object like this: My first test failed at step 3 I think. Somehow the URL recorded in the database object is: https://bubble.io/“https://ourdomain.com/version-test/fileupload/f1697699989239x249811802206209250/115747.jpeg” (including the quotation marks).

We are not sure as to why we end up with this weird URL. Where did we go wrong?

1 Like

Hi @cowontherun I have a similar use case. I’m in the midst of learning the API connector, but here’s a beginner question: what is the part of your solution that actually writes (or uploads) the private file? Are you wrapping some sort of 3rd party service with the API connector? (Sorry, confused)

Hi there, when you go to add a new action in Workflows (which you would do in Backend Workflows), you select the API Call by selecting Plugins > [Name of API Call], which in my case is ‘Make recording private’ and changing the parameter values there.

Hi there,

Do you know if there’s a file size limit for this? I’ve tried a 46mb file and it works, but 50+ doesn’t seem to work at all. Any way to overwrite this?

Thanks!

How is it still not possible to natively do this with bubble?

2 Likes

Apparently its easily possible with this plugin
File Uploader Bubble API Plugin | Bubble

But, saving the file again as public file doesn’t work