send_data attachment over ssl to IE ?

Hi and thanks if you can help…

I have a quirk in my application : i can’t make send_data to stream for download (disposition=attachment) an image over SSL with internet explorer.

Works fine with FF (ssl or not), works fine inline (ssl or not, IE or FF), works even fine without ssl (still IE).

But when i try to get the link through SSL, IE somehow gives me a :

“cannot download blabla from someurl, not able to open this internet site, requested site either unavailable or cannot be found. please try again later…”

Of course it doesn’t work later. The only thing i could find about this is from the rails api on send_file : “IE versions 4, 5, 5.5, and 6 are all known to have a variety of quirks (especially when downloading over SSL)”

see my source below. I’m using lighttpd with fcgi, nothing fancy.

def download

qr = blabla (edit)

send_data(qr.to_blob, :filename => qr.code+'.png', :type =>

‘image/x-png’, :disposition => ‘attachment’, :streaming => ‘true’, :buffer_size => ‘4096’ )


Any ideas, suggestion, quirk-remover-spray ? (I’m desperate…)


Hi Stan - Rails sets the HTTP header Cache-Control: no-cache by default. IE cries big tears when you download a no-cache file over SSL since, internally, it can’t save the file to the disk cache! Reference and

Please try headers.delete (‘Cache-Control’) before the call to send_data. Also see the expires_at and expires_now for a Railsy take on HTTP caching.

Best, jeremy

Thanks ! Works great ! Had to delete the pragma as well.

I have another issue with IE on this actually, it doesn’t look like caring much about my type=>‘image/x-png’ : I get Type: Unkown File Type.

I’ve been careful to check that this one was on the list of known mime types (), and I know from that article that IE checks the 256 first bytes to ensure the type matches the data. Is there a problem with my image (built within rmagick) or is it related to headers and cache once again ? (first fix didn’t do much for that other problem). here is my to_blob : def to_blob(fileformat=‘PNG’) draw() return @imgl.to_blob do self.format = fileformat end end Stan Jeremy Kemper wrote: