...

View Full Version : How can i work around this?



evoxx
06-23-2010, 12:37 AM
Hi guys,

I'm using a component in Joomla and at the moment when you try to download a file you are given this in the url bar



index.php/documents/doc/29/raw


There must be some redirect as you end up with



pdfdoc.pdf


Prompting to download, But users are unable to "Open" it directly, As im assuming the browser doesn't recognize this as a pdf and give the ability to open it.

They are able to save the document to there computer and open it that way but i've had comments on how much of a pain that is, Would a .htaccess modification of any kind help?

hoothelp
07-07-2010, 10:54 AM
Hello,

Depending on your server's allowed htaccess directives, you can indeed modify this behavior.

You need access to Apache's mod_headers (http://httpd.apache.org/docs/2.0/mod/mod_headers.html) module. Essentially your are doing the opposite of this tutorial (http://www.thingy-ma-jig.co.uk/blog/06-08-2007/force-a-pdf-to-download).

Where they are setting Content-Disposition to force the immediate download, you need to unset this header.

e.g.:


<FilesMatch "\.(?i:pdf)$">
ForceType application/pdf
Header unset Content-Disposition
</FilesMatch>

If that doesn't fix it for you, provide a sample PDF link and I'll take a closer look at the headers and Joomla source.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum