Find the answer to your Linux question:
Results 1 to 2 of 2
hi, I tried to force download of certain file types - pdf,doc,jpg - instead of opening them in applications. I used AddType application/octet-stream .pdf and AddType application/force-download .pdf but it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    1

    .htaccess and forced download of certain file types


    hi,
    I tried to force download of certain file types - pdf,doc,jpg - instead of opening them in applications. I used
    AddType application/octet-stream .pdf
    and
    AddType application/force-download .pdf
    but it doesnt works. Has anybody an idea how to solve this problem? thx, brdik

  2. #2
    Linux Engineer b2bwild's Avatar
    Join Date
    Jul 2008
    Location
    Behind You!
    Posts
    1,108
    add this in .htaccess

    <Files *.pdf>
    ForceType application/octet-stream
    Header set Content-Disposition attachment
    </ Files>
    Never make any misteaks.

    Read my Blog at --> Penguin Inside Subscribe Feed

Posting Permissions

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