Before filefield was merged, this patch #485336: Make Content-Disposition configurable for private downloads was added to allow admins to configure which filetypes were presented inline and which were presented as an attachment. This requires the admin to set the variable with PHP code!
variable_set('filefield_inline_types',array('image\/*', 'text\/*', 'flash$', 'audio\/midi'));
This is still the case in D7 and I find it ridiculous. I have a module which adds a simple box to set the variable, but that's a stupid way to do it. If I get time, I'll write up a patch to present the inline/attachment option as a field formatter.
Comments
Comment #1
binford2k commentedof course, that variable is called
file_inline_typesnow.Comment #2
bfroehle commentedAnother option would be #61528: Private files show open/save prompt for PDFs, etc. while public files automatically open inline which removed the Content Disposition line all together.
Comment #3
quicksketchAdding this as a field formatter sounds reasonable. I resisted adding any such option to FileField itself, considering for most sites this is an esoteric option. I still think it's rather edge-casey but at least by making it a formatter setting it's placing the option in the right location. Of course we shouldn't show this option at all unless you're using private files, since public files Content-disposition headers are set by the web server.
Comment #4
boozedog2 commented+1 Please add this feature!
Comment #11
iyyappan.govind+1 good feature if it available in field for-matter settings
Comment #19
kim.pepperThis feature request was posted against D7 which is no longer supported. If there is a feature request that would apply to Drupal 11+ then please feel free to update the Issue Summary and describe the details of that request.
Comment #20
smustgrave commentedSince there's been no follow up and as a feature request going to close out. Can always be re-opened
Thanks all!