I’m attempting to GET a PDF file via Mongrel in my development
environment, and instead of returning a PDF file, I see it rendered as
text (%PDF-1.5 …etc.) in my browser window.
I was aware that Mongrel has a fairly limited set of mime-types that are
handled by default, so I went ahead and attempted to add the PDF
mime-type to the Mongrel handler.rb, like so:
“.pdf” => “application/pdf”
After I reboot, I still get the junk and not the PDF. My browser has no
problems opening PDF files.
What gives? Am I specifying the wrong mime-type?