Max Williams
2009-Aug-05 11:08 UTC
send_file, pdf and inline option. Can''t display in browser
hey all i''m trying to send a pdf to the browser, to display inline, like this: send_file("#{RAILS_ROOT}/tmp/#{filename}", :filename => filename, :disposition => "inline") But, it keeps coming through as a downloadable attachment rather than being shown in the browser. I don''t think it''s my firefox settings because when i go to other pages that have pdf links then they''re shown inline, eg http://www.thefms.org/wp-content/uploads/2009/05/fms-programme_lr.pdf Can anyone see the problem? thanks max -- Posted via http://www.ruby-forum.com/.
Frederick Cheung
2009-Aug-05 11:13 UTC
Re: send_file, pdf and inline option. Can''t display in browser
On Aug 5, 12:08 pm, Max Williams <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> hey all > > i''m trying to send a pdf to the browser, to display inline, like this: > > send_file("#{RAILS_ROOT}/tmp/#{filename}", > :filename => filename, :disposition => "inline") > > But, it keeps coming through as a downloadable attachment rather than > being shown in the browser. I don''t think it''s my firefox settings > because when i go to other pages that have pdf links then they''re shown > inline, egTry supplying the content type Fred> > http://www.thefms.org/wp-content/uploads/2009/05/fms-programme_lr.pdf > > Can anyone see the problem? > > thanks > max > -- > Posted viahttp://www.ruby-forum.com/.
Max Williams
2009-Aug-05 11:21 UTC
Re: send_file, pdf and inline option. Can''t display in browser
Frederick Cheung wrote:> On Aug 5, 12:08�pm, Max Williams <rails-mailing-l...-ARtvInVfO7m5VldFQK4jKA@public.gmane.orgt> > wrote: >> inline, eg > Try supplying the content type > > Fredyeah - i was just about to post this :) Never mind, i didn''t set the type - it works with this option added: :type => "application/pdf" cheers fred max -- Posted via http://www.ruby-forum.com/.