[Note: The following solution worked for PDFs - not sure what type of file/document you’re using, you may need a different method for other document types.]
Since I had lots of docs to preview, I used a repeating group (RG).
Then, in the RG cell, draw an HTML element. Within the element, I used <iframe src= [ ENTER YOUR "CURRENT CELL’S [PDF FILE ] HERE ]
/frameborder=“0” width=“580” height=“569” allowfullscreen=“true” mozallowfullscreen=“true” webkitallowfullscreen=“true”>
That should do it. If you want to add visibility options (such as to buttons and so on you can do that too. I used a preview option (the small view) and then used a button to send it to a larger popup that let’s you see the file in all its glory.
A note about the [ENTER CURRENT CELL’S PDF FILE HERE ]: for this you can just use the data field name you used to store the PDFs in; you do not have to use any of the subsequent syntax options such as ’ ‘s URL’, ‘:saved to S3’ or ’ ‘s file name’ - just stop at the Current cell’s [PDF field name].
By the way, most of the credit (if not all) goes to @NigelG since I think I learned how to do the framing from one of his posts elsewhere - if I recall correctly it was about displaying a Google slide show/presentation or something like that.
When I try this the browser ends up downloading (or prompting to) all the files instead of displaying.
I created the RG that has a source of search for Files and entered the “Current cell’s File File” in the iframe. Not sure what I’m missing but I might want to look for another file previewer altogether and see how to incorporate in Bubble as I need to preview Word files too…
With Google I had to add the http part as the amazon link doesnt have the http by default. I had to ad the ‘URL’ part to the dynamic part too for it to work. Please note that my string says ‘File’ but that is the way I named my Thing.
The only downside is that these viewers do not seem to support images so I would have to create something else for that if I want to show them in the same RG. Perhaps a filter based on the file extension?