View PDFs in browser?

Hi there :wave:

I have a document upload web form that has multiple file upload fields so that applicants can upload documents. People may submit one form or several and upload one file or several per field. Both the applicants and documents table are linked.

  1. How do I display the PDFs in a page on the application builder? When I use the link element (in a repeat element), instead of opening the PDF in a separate tab in my browser (latest Chrome), it downloads the file to my computer instead and its filename is a long hash instead of the original uploaded filename. Is there any way to just display it in browser or at last make sure the filename is the original one?

  2. This is just a note but the Documents data source (multiple rows) is quite confusing. Do I choose Documents > [All] > CV > 0 > url or Documents > 0 > CV > [All] > url or any of the other permutations it’s just a bit hard to understand if they’re the same or different or which one to use when.

I’m self hosting Baserow.

Would appreciate any pointers :slight_smile:

So after consulting chatGPT, it looks like part of the “problem” (it’s probably a deliberate design choice that I don’t have the context for) is that Baserow is serving the PDF with the Content-Disposition: attachment header, which forces a download.

It feels wrong to try and dabble with the Caddy configuration on my installation but I’m curious if there is a recommended way to enable Content-Disposition: inline for PDF uploads? (I didn’t find anything obvious here: Configuring Baserow)

@frederikdc could you please help with this request? :slightly_smiling_face:

Documents is probably a Link to table field. This field type can hold multiple related fields. So, you need to choose if you want them all or just the first (0) item.

CV is probably a File field. This field type can also hold multiple documents. So again, you can choose for all or a specific item.

Since the File field itself can hold multiple documents, I’m not sure if you also need the Documents field as a linked table.

It should be possible to open a pdf document in the browser. I have a data source that gets all records associated with a task.


Each record has a File field

I use this data source in a repeat element

Inside the repeat element, I add a Link element. The name I am adding is one i have set myself. The url is the one of the first item in my File field. This works since I have only one file in the field. Otherwise I would have needed another repeat element

If I click the hyperlink, it opens the pdf document in browser