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.
There is some lovely code in file_file_download that determines what a file object's headers should be on download. If it's an image or text, it sets the content-disposition to inline; if it's a PDF or something, it sets it to force a download. It also sets the content type and length correctly. Unfortunately, all this lovely code is buried inline, inside of file_file_download(), where contrib can't reuse it. Patch forthcoming.
Comment | File | Size | Author |
---|---|---|---|
#1 | 943112-1-file-headers.patch | 2.3 KB | ksenzee |
Comments
Comment #1
ksenzeeComment #2
Stevel CreditAttribution: Stevel commentedThis is working good.
No API change here, only an API addition.
Comment #3
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.