PDF gets always downloaded #5212

Closed
opened 2026-02-05 09:48:49 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @bombobama on GitHub (Mar 7, 2025).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

Hello,

I uploaded a PDF as attachment and created a link to open it in a new tab.
The problem is that the PDF always gets downloaded and doesn't open inline.
This occurs with Chrome, Edge and Firefox only for Firefox it opens in new tab after downloading.
I already checked browser settings, and webserver configuration. I haven't found a way to get the attachments to open inline.
Am i missing something? Can someone help me?

Thank you

Exact BookStack Version

v24.12.1

Log Content

No response

Hosting Environment

php 8.2, SLES15-SP6, apache2

Originally created by @bombobama on GitHub (Mar 7, 2025). ### Attempted Debugging - [x] I have read the debugging page ### Searched GitHub Issues - [x] I have searched GitHub for the issue. ### Describe the Scenario Hello, I uploaded a PDF as attachment and created a link to open it in a new tab. The problem is that the PDF always gets downloaded and doesn't open inline. This occurs with Chrome, Edge and Firefox only for Firefox it opens in new tab after downloading. I already checked browser settings, and webserver configuration. I haven't found a way to get the attachments to open inline. Am i missing something? Can someone help me? Thank you ### Exact BookStack Version v24.12.1 ### Log Content _No response_ ### Hosting Environment php 8.2, SLES15-SP6, apache2
OVERLORD added the 🐕 Support label 2026-02-05 09:48:49 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 7, 2025):

Hi @bombobama,

Are you using the attachment link gained via the "Open in Tab" option as displayed here?:

Image

This is just a normal attachment link, with ?open=true added to the end.
This should allow it to be opened inline (If detected as an allowed file format, which PDF should be).

@ssddanbrown commented on GitHub (Mar 7, 2025): Hi @bombobama, Are you using the attachment link gained via the "Open in Tab" option as displayed here?: ![Image](https://github.com/user-attachments/assets/507a740c-b56d-4c58-9222-a6a05fc6b9b2) This is just a normal attachment link, with `?open=true` added to the end. This should allow it to be opened inline (If detected as an allowed file format, which PDF should be).
Author
Owner

@bombobama commented on GitHub (Mar 11, 2025):

Hi @ssddanbrown thank you for responsing,

what you showed works, but that's not what I meant. I was talking about embedding an attachment as a link in a text and then clicking on that link to open it in a new tab. When I do that, it always gets downloaded. A simple attachment link like this:

Image

@bombobama commented on GitHub (Mar 11, 2025): Hi @ssddanbrown thank you for responsing, what you showed works, but that's not what I meant. I was talking about embedding an attachment as a link in a text and then clicking on that link to open it in a new tab. When I do that, it always gets downloaded. A simple attachment link like this: ![Image](https://github.com/user-attachments/assets/5d96f360-69d8-432d-93fa-b2f4f365adaa)
Author
Owner

@ssddanbrown commented on GitHub (Mar 11, 2025):

@bombobama That "Open in Tab" button is just a normal link also.

How exactly is your link configured? What is the URL used?

@ssddanbrown commented on GitHub (Mar 11, 2025): @bombobama That "Open in Tab" button is just a normal link also. How exactly is your link configured? What is the URL used?
Author
Owner

@bombobama commented on GitHub (Mar 12, 2025):

I uploaded the pdf as attachment and inserted this attachment as a link on a page. URL looks like this: https://example-site/bookstack/attachments/7)
I just checked the URLs again and saw that for "open in tab" the URL ends with "?open=true", which is not the case for the embedded link on the page.
However, I did not see an option for this here:

Image

I can manually edit the link to get the wanted result, but I would say this is not really intuitive for standard users. Maybe i am missing something?

@bombobama commented on GitHub (Mar 12, 2025): I uploaded the pdf as attachment and inserted this attachment as a link on a page. URL looks like this: **https://example-site/bookstack/attachments/7**) I just checked the URLs again and saw that for "open in tab" the URL ends with "?open=true", which is not the case for the embedded link on the page. However, I did not see an option for this here: ![Image](https://github.com/user-attachments/assets/68c647c7-768a-4d1b-b32d-ed8dabe13f31) I can manually edit the link to get the wanted result, but I would say this is not really intuitive for standard users. Maybe i am missing something?
Author
Owner

@ssddanbrown commented on GitHub (Mar 12, 2025):

Yeah, there's no option on the attachment edit form itself.
You do just manually edit the link to append the open part (or copy the "Open in Tab" link originally and insert that).

@ssddanbrown commented on GitHub (Mar 12, 2025): Yeah, there's no option on the attachment edit form itself. You do just manually edit the link to append the open part (or copy the "Open in Tab" link originally and insert that).
Author
Owner

@bombobama commented on GitHub (Mar 12, 2025):

Ok, thank you you very much! Maybe this could be added in future.

@bombobama commented on GitHub (Mar 12, 2025): Ok, thank you you very much! Maybe this could be added in future.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5212