Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How can i work around this?

    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

    Code:
    index.php/documents/doc/29/raw
    There must be some redirect as you end up with

    Code:
    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?

  • #2
    New Coder
    Join Date
    Mar 2010
    Location
    Virginia, USA
    Posts
    25
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Hello,

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

    You need access to Apache's mod_headers module. Essentially your are doing the opposite of this tutorial.

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

    e.g.:

    Code:
    <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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •