Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
I have noticed there is no way to alter the content headers supplied by file_get_content_headers() in includes/file.inc
In my situation this was problematic for generated zip-files. For some unknown reason the Content-Length header made the zip-file corrupt after downloading through Drupal, while opening after directly downloading through SSH was no problem.
A small patch is included which adds a drupal_alter and documentation. I'm not sure if it's in the right place or perhaps there's a better solution, so please review.
Comment | File | Size | Author |
---|---|---|---|
#1 | file_content_headers_alter-2516674-1.patch | 1.51 KB | jorisdejong |
Comments
Comment #1
jorisdejong CreditAttribution: jorisdejong commentedComment #2
MrHaroldA CreditAttribution: MrHaroldA at iO commentedComment #3
cilefen CreditAttribution: cilefen commented@jorisdejong See if Drupal 8 needs this too. If it does, it must go there first https://www.drupal.org/core/backport-policy. If not, carry on.