Forum: Ruby on Rails Image Downloads in IE

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Keith D. (Guest)
on 2007-02-07 17:25
(Received via mailing list)
Hi,

This may not be a rails issue, if not apologies.

I have an application which allows image downloads.

The image is downloaded with the code:
send_data(@wallpaper.image,
            :filename => @wallpaper.path,
            :type => @wallpaper.image_content_type,
            :disposition => "downloaded")

However, Internet Explorer doesn't download the image, it just displays
it.
I know can do the
whole 'Right click and choose save as' thing but I was wondering is
there a
method of
avoiding this with rails.

Thanks in advance,

Keith
Zack C. (Guest)
on 2007-02-07 18:21
(Received via mailing list)
On 2/7/07, Keith D. <removed_email_address@domain.invalid> wrote:
>             :disposition => "downloaded")
>
> However, Internet Explorer doesn't download the image, it just displays it.
> I know can do the
> whole 'Right click and choose save as' thing but I was wondering is there a
> method of
> avoiding this with rails.
>
> Thanks in advance,
>
> Keith

Keith,

Try it without setting the :disposition (which doesn't appear to be a
valid value).

send_data(@wallpaper.image,
                  :filename => @ wallpaper.path,
                  :type => @wallpaper.image_content_type)

--
Zack C.
http://depixelate.com
Keith D. (Guest)
on 2007-02-07 18:36
(Received via mailing list)
Thanks Zack,

Its working perfectly now.

Not sure I picked up that :disposition value but it must have been in an
example
somewhere.

Keith
This topic is locked and can not be replied to.