[OT] PDF's not Downloading in Win/IE

I have a Rails app that’s working perfectly (http://amuinsurance.com),
but on
Windows IE and no other browser, if I go for the URL:
http://amuinsurance.com/content/marine_insurance.pdf

View this message in context:
http://www.nabble.com/-OT--PDF's-not-Downloading-in-Win-IE-tf2034599.html#a5597794
Sent from the RubyOnRails Users forum at Nabble.com.

how is your server setup? Apache 1.3 + mod_fastcgi, Apache 2 +
mod_fcgid, Apache 2 + Mongrel, lighttpd?

Mike

Thanks for the quick reply.

Apache 2 on Fedora proxied to lighttpd/mod_fastcgi. Everything else is
working fine, but not this.

Mike G.-2 wrote:

Windows IE and no other browser, if I go for the URL:
http://amuinsurance.com/content/marine_insurance.pdf


View this message in context:
http://www.nabble.com/-OT--PDF's-not-Downloading-in-Win-IE-tf2034599.html#a5598569
Sent from the RubyOnRails Users forum at Nabble.com.

On 8/1/06, s.ross [email protected] wrote:

I have a Rails app that’s working perfectly (http://amuinsurance.com), but on
Windows IE and no other browser, if I go for the URL:
http://amuinsurance.com/content/marine_insurance.pdf

For reasons I’m not sure about, feeding a pdf inline to IE doesn’t
work a lot of the time. Change the code to send it as an attachment.

Resolved: This works:

def content
send_file(File.join(‘path’, ‘to’, ‘my’, ‘file.pdf’), :type =>
‘application/pdf’, :disposition => ‘inline’) and return
end

I used a route to get the user here.

Thx again.

snacktime wrote:

For reasons I’m not sure about, feeding a pdf inline to IE doesn’t
work a lot of the time. Change the code to send it as an attachment.


View this message in context:
http://www.nabble.com/-OT--PDF's-not-Downloading-in-Win-IE-tf2034599.html#a5600208
Sent from the RubyOnRails Users forum at Nabble.com.

-----Original Message-----
From: [email protected] [mailto:rails-
[email protected]] On Behalf Of s.ross
Sent: Tuesday, August 01, 2006 11:13 AM
To: [email protected]
Subject: [Rails] [OT] PDF’s not Downloading in Win/IE

I have a Rails app that’s working perfectly (http://amuinsurance.com),
but
on
Windows IE and no other browser, if I go for the URL:
http://amuinsurance.com/content/marine_insurance.pdf

I had a huge problem like this a few weeks ago, and I don’t think it is
specific to rails. Just serving static PDF’s was the problem.

It only happens on IE + Acrobat Reader attempting to open in the same
window, and (I believe) only if they are configured via named virtual
host.

If I used FF, everything worked. If I used xpdf or such, everything
worked. Wget worked. Acrobat full version worked. If I used IE +
Acrobat Reader with the ‘open in same window’ option turned off, it
worked.

I installed several servers to see where it would replicate:

Apache 1.3.36 (from source)
Apache 2.0.48 (Suse Linux 9 RPM) <–broken
Apache 2.0.48 (from source)
Apache 2.0.49 (from source)
Apache 2.0.58 (from source)
Apache 2.2.2 (from source)
Lighttpd 1.4.11 (from source) <–broken

I found that only the 2.0.48 RPM from SUSE linux and lighty caused the
problem.

I solved Lighty via a post I found on google:
$HTTP[“url”] =~ “.pdf$” { server.range-requests = “disable” }

As I plan to retire the SUSE 9 distro soon, I temporarily solved the
rest of the problem by redirecting PDF downloads to a 2.0.49 instance
via:

RewriteEngine on
RewriteRule ^(.*.pdf)$ http://www.example.com:22049/$1

I’m curious to know if the problem affects other versions. Could you
tell me the distro of Linux and versions of Apache, IE, and Acrobat
Reader that cause the problem?

Thanks.

Regards,

Rich D.

on
Windows IE and no other browser, if I go for the URL:
http://amuinsurance.com/content/marine_insurance.pdf

I solved Lighty via a post I found on google:
$HTTP[“url”] =~ “.pdf$” { server.range-requests = “disable” }

We solved it the same way…

One issue I ran into a couple of years ago is that IE will download
(itself) PDF’s up to about a meg. Then it will decide it’s too big, and
hand it off to Adobe to do.

Which means if you have any http-auth credentials, or the PDF is the
result of a POST, you are fubarred…

Not sure this is your problem, but something to keep in mind. And maybe
it’s changed, but it drove me nuts when it happened to me…

-philip

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