Hi everyone!
Bubble have some limitations when getting a file and setting privacy on that file. For example, if you set “File” as the type in API Connector, this file is not private.
More than that, when using API Connector, in some case, the file doens’t have an extension or a correct filename.
This plugin was made for this kind of limitations. You continue to get the file like you did, you pass the file url to the plugin that will upload a new version, renamed if needed and with full privacy settings (including attach to…)
This tool use the Bubble file Uploader API to take a file from url and send it to Bubble file storage. You can use this to:
Rename a file
Set privacy on file
This is just one Server side action
Use the action File Upload
In “Base Website Url” field, you should use Website Home url. Note that files upload are version related.
Complete all others field according to your need. Don’t forget to set the file extension in filename field.
After the action, the plugin will return the new uploaded file.
Don’t forget to delete original file if needed.
Hey @Jici !
I was trying to use this plugin to upload a file from an url to bubble storage, but for some reason it isn’t doing it appropriately.
For eg: I have a pdf created and its on https://us1.pdfgeneratorapi.com/. I want this pdf to be uploaded to bubble’s file store and save the new url in the db.
Base webhsite url should be your app url, not a custom url.
The dynamic link should be the file url you want to upload to Bubble File API. The base url is just to know your app url to use the Bubble file API.
Actually, I don’t think you are using this correctly.
You probably already call the pdfgenerator API in step 1? Does it return a file or a url?
The PDF generator plugin returns the url of the file without an issue. I am good using that, but they would store the file for 30 days max before deleting it. Hence, trying to figure out a way to push it to bubble storage so that it hangs around there for longer.
Th easiest way to save it in bubble is just to add :saved to s3 if this return a url. This step should also let you rename the file. The plugin is more to use when the API return directly a file, in this case, Bubble save it automatically into Bubble storage, but you have no power on the name. Another use case is (and could apply to you) if you want to set privacy rules on the file (:saved to s3 doesn’t have option to make this file private)
Be sure, in API connector, to have set the file parameters as a “file” type… not text (that is default)
Surprisingly I do not see the :saved to s3 option. Which is why the workaround.
Btw the pdf gen plugin also returns the base64 encoded string, could that be of used?
If you don’t see it, this is because you didn’t set the url field in API Connector to be type of file.
Please share your initialized API Connector settings
Hi, @Jici. Your plugin sounds great, but I’m having trouble getting it to fully work. Can you help?
I confirmed I’m using the plugin’s current version (“1.1.0 - Updated to node 18”). I also tried downgrading to the immediate prior version (“1.0.0 - Public release”), but still wasn’t successful.
The “File Upload” action uploads the file as expected, including renaming and attaching for privacy. However, I can’t reference the File Upload action’s outputs in order to save a reference to the new file in a field.
I confirmed there are no privacy rules precluding reference to fields or attached files in the data type where the file is attached.
Here’s my workflow. It runs when a file is created by the 1T - CSV Creator plugin’s “CSV Creator” event.