Posted by antiorario on November 16, 2009 at 3:34pm
Jump to:
| Project: | FileField |
| Version: | 6.x-3.2 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I suppose this question has been asked somewhere, but I can't seem to find a solution.
In the websites I manage, PDF files uploaded via FileField are downloaded instead of displayed in the browser window. Of course I'm talking about the browsers—like Safari and IE—that support in-browser PDF display. The Upload module allows this, and it seems strange that FileField doesn't.
Any suggestions?
Thanks.
Comments
#1
Are you using private or public downloads (set at admin/settings/file-system)? There's the opposite (force a file to download) instructions at http://drupal.org/node/417866 for public downloads. For private downloads you need to set a hidden variable "filefield_inline_types" by putting this in your settings.php:
<?php$conf['filefield_inline_types'] = array('^text/', '^image/', 'flash$', 'application/pdf');
?>
#2
Sorry for the delay, but for some reason I'm not receiving e-mail notifications of issue updates.
Thanks for the input. I'm using private downloads, and I'll definitely try that and see what happens.
#3
#4
I finally tried it, and it worked perfectly. Of course I realized that the same can be achieved, in the appropriate context (such as a module install function), with:
<?phpvariable_set('filefield_inline_types', array('^text/', '^image/', 'flash$', 'application/pdf'));
?>
I'm mostly writing this as a note to myself—and to anyone who might be interested.