send_file - PDF

93 views
Skip to first unread message

pete

unread,
Feb 12, 2008, 12:45:39 PM2/12/08
to Ruby on Rails: Talk
Hi-

I'd like to load a PDF file into a page, in my controller:

send_file "/path to/my.pdf", :disposition => "inline"

However, instead of rendering inline, it asks to download the file.

How can I display the contents without downloading?

Thanks!

Peter De Berdt

unread,
Feb 12, 2008, 12:55:56 PM2/12/08
to rubyonra...@googlegroups.com
As far as I know, this is a browser preference. In Safari, they will show in the browser, unless the user has disabled it using:

defaults write com.apple.Safari WebKitOmitPDFSupport -bool YES

On Windows, it largely depends on whether the Adobe Acrobat Reader is installed and configured to load it into the browser.


Best regards


Peter De Berdt


pete

unread,
Feb 12, 2008, 1:01:28 PM2/12/08
to Ruby on Rails: Talk
Hmm, I'll look at that.

Do I need to do anything in the view?

pete

unread,
Feb 12, 2008, 1:13:01 PM2/12/08
to Ruby on Rails: Talk
I don't see any preferences in Mozilla in terms of how to render a PDF
file. Could it be related to anything else?
Reply all
Reply to author
Forward
0 new messages