Making a file private
Bubble provides you with the ability to link files to a specific database record and inherit the privacy rules associated with that record.
See this section of the Bubble manual for further details
Instructions
You can make a PDF generated by PDF Potion using the 'MAKE THIS FILE PRIVATE' fields on the 'Create PDF' action. In order to make a file private, you'll need to:
- Check the 'Make this file private' option
- Specify a thing to attach the file to (via its unique ID)
In the above example, we're attaching the PDF generated by PDF Potion to the current user.
Please note: You must specify the unique ID of the thing you are attaching the file to. This is a bit different to the standard Bubble file uploader element, where you can just add the 'thing' without including the unique ID.
These are the privacy rules that are set on the user data type in our example:
This means that when the user is logged in, they can still access the PDF. But if another user tries to access the URL associated with the PDF they'll get blocked: