[PR #2791] [MERGED] Attachment serving without forced download #6069

Closed
opened 2026-02-05 10:23:49 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/2791
Author: @ssddanbrown
Created: 6/6/2021
Status: Merged
Merged: 6/13/2021
Merged by: @ssddanbrown

Base: masterHead: attachments_open_in_browser


📝 Commits (2)

  • 888f435 Added back-end attachments-in-browser support
  • 7997300 Added front-end toggle and testing of inline attachments

📊 Changes

9 files changed (+122 additions, -35 deletions)

View changed files

📝 app/Http/Controllers/AttachmentController.php (+13 -9)
📝 app/Http/Controllers/Controller.php (+15 -0)
📝 app/Uploads/Attachment.php (+2 -2)
📝 app/Uploads/AttachmentService.php (+5 -5)
📝 composer.json (+1 -0)
resources/js/components/attachments-list.js (+47 -0)
📝 resources/js/components/index.js (+2 -0)
📝 resources/views/attachments/list.blade.php (+10 -8)
📝 tests/Uploads/AttachmentTest.php (+27 -11)

📄 Description

This allows Ctrl/Cmd clicking of attachments to open them with an ?open=true query string which responds with an inline content-disposition and does some content-type sniffing to set an expected Content-Type.

Related to #1464, #705, #1270


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/2791 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 6/6/2021 **Status:** ✅ Merged **Merged:** 6/13/2021 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `master` ← **Head:** `attachments_open_in_browser` --- ### 📝 Commits (2) - [`888f435`](https://github.com/BookStackApp/BookStack/commit/888f435651d733570293f71b8d0fab09c4ae0169) Added back-end attachments-in-browser support - [`7997300`](https://github.com/BookStackApp/BookStack/commit/7997300f966103d8f945422fc0a38bef9f5bdbaa) Added front-end toggle and testing of inline attachments ### 📊 Changes **9 files changed** (+122 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `app/Http/Controllers/AttachmentController.php` (+13 -9) 📝 `app/Http/Controllers/Controller.php` (+15 -0) 📝 `app/Uploads/Attachment.php` (+2 -2) 📝 `app/Uploads/AttachmentService.php` (+5 -5) 📝 `composer.json` (+1 -0) ➕ `resources/js/components/attachments-list.js` (+47 -0) 📝 `resources/js/components/index.js` (+2 -0) 📝 `resources/views/attachments/list.blade.php` (+10 -8) 📝 `tests/Uploads/AttachmentTest.php` (+27 -11) </details> ### 📄 Description This allows Ctrl/Cmd clicking of attachments to open them with an `?open=true` query string which responds with an `inline` content-disposition and does some content-type sniffing to set an expected `Content-Type`. Related to #1464, #705, #1270 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:23:49 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#6069