[ticket/17447] Add http range requests to attachments downloads#6766
Merged
marc1706 merged 2 commits intophpbb:masterfrom Mar 28, 2026
Merged
[ticket/17447] Add http range requests to attachments downloads#6766marc1706 merged 2 commits intophpbb:masterfrom
marc1706 merged 2 commits intophpbb:masterfrom
Conversation
3c2c499 to
a63c5c3
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR adds HTTP range request support for attachment downloads in phpBB. The implementation enables partial content delivery (e.g., for video streaming and resumable downloads) by leveraging Symfony's BinaryFileResponse for local storage while maintaining backward compatibility with other storage providers through StreamedResponse.
Key Changes:
- Refactored the attachment controller to use
BinaryFileResponsefor local storage (which natively supports range requests) andStreamedResponsefor other storage providers - Consolidated database connection cleanup and cache unloading logic across storage controllers
- Replaced deprecated
makeDispositioncalls withHeaderUtils::makeDisposition
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| phpBB/phpbb/storage/controller/controller.php | Moved response preparation logic from prepare() to handle() method; removed file_gc() method |
| phpBB/phpbb/storage/controller/avatar.php | Updated to use HeaderUtils::makeDisposition and changed type hint from StreamedResponse to Response |
| phpBB/phpbb/storage/controller/attachment.php | Refactored to no longer extend controller class; added conditional logic for BinaryFileResponse vs StreamedResponse; extracted database queries into helper methods |
| phpBB/develop/adjust_avatars.php | Fixed incorrect config key check from avatar to attachment provider |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
marc1706
reviewed
Mar 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist:
Tracker ticket:
https://tracker.phpbb.com/browse/PHPBB-17447
Depends on #6753