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

On Aug 5, 12:08 pm, Max W. [email protected]
wrote:

inline, eg
Try supplying the content type

Fred

Frederick C. wrote:

On Aug 5, 12:08�pm, Max W. [email protected]
wrote:

inline, eg
Try supplying the content type

Fred

yeah - i was just about to post this :slight_smile:

Never mind, i didn’t set the type - it works with this option added:

   :type => "application/pdf"

cheers fred
max

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs