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

**URL:** <https://www.ruby-forum.com/t/ot-pdfs-not-downloading-in-win-ie/100870>\
**Category:** Rails\
**Created:** [August 1, 2006, 6:15pm UTC](https://www.ruby-forum.com/t/ot-pdfs-not-downloading-in-win-ie/100870 "2006-08-01T18:15:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [August 1, 2006, 6:15pm UTC](https://www.ruby-forum.com/t/ot-pdfs-not-downloading-in-win-ie/100870/1 "2006-08-01T18:15:50Z")

</div>

## I have a Rails app that’s working perfectly ([http://amuinsurance.com](http://amuinsurance.com)), but on Windows IE and no other browser, if I go for the URL: [http://amuinsurance.com/content/marine\_insurance.pdf](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](http://www.nabble.com/-OT--PDF%27s-not-Downloading-in-Win-IE-tf2034599.html#a5597794)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [August 1, 2006, 6:25pm UTC](https://www.ruby-forum.com/t/ot-pdfs-not-downloading-in-win-ie/100870/2 "2006-08-01T18:25:55Z")

</div>

how is your server setup? Apache 1.3 + mod\_fastcgi, Apache 2 +  
mod\_fcgid, Apache 2 + Mongrel, lighttpd?

Mike

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [August 1, 2006, 6:55pm UTC](https://www.ruby-forum.com/t/ot-pdfs-not-downloading-in-win-ie/100870/3 "2006-08-01T18:55:43Z")

</div>

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](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](http://www.nabble.com/-OT--PDF%27s-not-Downloading-in-Win-IE-tf2034599.html#a5598569)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [August 1, 2006, 7:20pm UTC](https://www.ruby-forum.com/t/ot-pdfs-not-downloading-in-win-ie/100870/4 "2006-08-01T19:20:43Z")

</div>

On 8/1/06, s.ross [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have a Rails app that’s working perfectly ([http://amuinsurance.com](http://amuinsurance.com)), but on  
> Windows IE and no other browser, if I go for the URL:  
> [http://amuinsurance.com/content/marine\_insurance.pdf](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.

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [August 1, 2006, 8:22pm UTC](https://www.ruby-forum.com/t/ot-pdfs-not-downloading-in-win-ie/100870/5 "2006-08-01T20:22:57Z")

</div>

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](http://www.nabble.com/-OT--PDF%27s-not-Downloading-in-Win-IE-tf2034599.html#a5600208)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [August 3, 2006, 1:22pm UTC](https://www.ruby-forum.com/t/ot-pdfs-not-downloading-in-win-ie/100870/6 "2006-08-03T13:22:00Z")

</div>

> -----Original Message-----  
> From: removed\_email\_address@domain.invalid [mailto:rails-  
> removed\_email\_address@domain.invalid] On Behalf Of s.ross  
> Sent: Tuesday, August 01, 2006 11:13 AM  
> To: removed\_email\_address@domain.invalid  
> Subject: [Rails] [OT] PDF’s not Downloading in Win/IE
> 
> ## I have a Rails app that’s working perfectly ([http://amuinsurance.com](http://amuinsurance.com)), but on Windows IE and no other browser, if I go for the URL: [http://amuinsurance.com/content/marine\_insurance.pdf](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](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.

---

<div class="post-metadata">

**Author:** ![cwd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/da6949/32.png) [@cwd](https://www.ruby-forum.com/u/cwd)\
**Post date:** [August 3, 2006, 1:23pm UTC](https://www.ruby-forum.com/t/ot-pdfs-not-downloading-in-win-ie/100870/7 "2006-08-03T13:23:29Z")

</div>

> > ## on Windows IE and no other browser, if I go for the URL: [http://amuinsurance.com/content/marine\_insurance.pdf](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
