Forum Academy Marketplace Showcase Pricing Features

How to attach File Manager to a thing (data type)?

Hi,
I use a plugin to create a PDF file that would be saved on File Manager, the PDF generated would be named the invoice number from the Invoice page, so it’s easy to find it in the back end (database), but I’d like to be able to attach that file to the invoice, which I couldn’t figure out.
Any idea?

Cheers.

Hey @vennio check this thread out. :vulcan_salute: Make File Private using workflow - #11 by ZubairLK

Hi, @andy.i, thanks for the response.
When I use the plugin to create that file, it’s automatically saved in the file manager, the file is not uploaded manually by user, therefore, I cannot do the settings as shown in the thread you provided.
Any clue how to do it without the manual upload part?
I want to

  1. attach the file to a thing (that invoice the file is generated from)
  2. retrieve the file’s URL and show it somewhere on the page so the user can download that file later.

Much appreciate it.

@vennio What plugin is it? There should be an event available like [your plugin element] PDF is ready then you can Make changes to a thing and set a thing’s file field to This [plugin element]'s PDF’s file (or whatever shows up)

@tylerboodman I found the custom event.
Thank you very much!

1 Like

@vennio gotcha. Sorry, i misunderstood your question.

Your method will make it easy to find in the database (PDF is ready event). The method I posted is useful if you want to attach the file to a data entry to protect it via privacy rules.

Some plugins also allow you to do this with a “attach to” field or similar.

If using ‘attach to’, how do you retrieve the file? I’m using Group to PDF and the file generates and stores in the file manager, but I don’t know how to retrieve it.

After the plugin creates and stores the PDF, I assume I’d have to store the reference to it? Is there any “get a list of files attached to current user” or something?

The plugin has to put the file somewhere, so it goes to your app’s storage, but leave that alone.
Most likely on your page your plugin adds an event like PDF is ready or something in the workflow tab. That would trigger when the PDF is created and you can do Make changes to a thing and save This [PDF element] File (or something) to your database in some Thing’s file field

(Just like @vennio did)

yeah, that’s what I tried, I was just curious if there was a built in method in bubble for accessing files if you use ‘attach to’. I guess that is only for privacy.

Yea I think they just want us to manage our own file structure by doing what I described.

IMO built-in Bubble file management is kind of garbage, everyone dumped on the same bucket, all files public by default AND no way to set a file to private after the fact, no actions to rename, no way to get the MIME/type, etc.

@agiledood
I concur.
I had the exact same question before I found that my plugin came with a workflow event to attach, perhaps you can ask your plugin’s developer if they developed such event for you to use in the workflow.
That being said, I’m still curious how to get the link for all my files in the file manager. I mean, maybe one day there will be files saved there without a workflow available, so it’s really important to know!

@tylerboodman
I didn’t know they’re all in the same bucket, how scary is that for security reasons!?
I tried Zpier+AWS briefly but didn’t have enough time to explore all the way before free trial ended.
Do you use any integration to save files on other servers?
Anything you recommend?
Much appreciate it!