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.
I've ran into a strange bug where if an action to "download files" is added to a view page, and then in turn the page display is rendered with panels, the resulting downloads get corrupt. Not entirely sure of the source of the problem, but this patch fixes it :)
Comment | File | Size | Author |
---|---|---|---|
#2 | media_browser_plus-occasional-corrupt-files-2589933-2.patch | 793 bytes | gfed |
media_browser_plus-occasional-corrupt-files.patch | 964 bytes | gfed | |
Comments
Comment #2
gfed CreditAttribution: gfed commentedUpon further investigation, it appears not setting the mimetype entirely works perfectly well in modern browsers.
Comment #3
das-peter CreditAttribution: das-peter at Cando commentedI'd like to keep the headers as all code, I know of, aims to provide proper headers, trusting the guessing power of the browser (modern or not) doesn't seem like the best idea.
Could you please test if these headers work for you:
Adding
application/octet-stream
apparently tells the browser to figure it out on its own if it's not happy with the previous header.According to all information I found on a quick search
application/zip
is a viable and valid content header, so if something goes wrong I'd say it's not the header :|The currently used content type is registered with iana: https://www.iana.org/assignments/media-types/application/zip which should make it a valid media type according to http://tools.ietf.org/html/rfc2616#section-14.17 -> http://tools.ietf.org/html/rfc2616#section-3.7 -> http://tools.ietf.org/html/rfc1590
http://stackoverflow.com/questions/20100445/zip-file-content-type-for-ht...
http://stackoverflow.com/questions/6977544/rar-zip-files-mime-type
Comment #4
gfed CreditAttribution: gfed commentedThose headers indeed get the job done, nothing corrupted, awesome.