Link to home
Start Free TrialLog in
Avatar of ddantes
ddantesFlag for United States of America

asked on

Force file download

When visitors click on a link to a pdf file in my website, I would like them to see a dialog box which invites them to save the file, instead of opening it.  This would avoid needing to instruct them to right click and save as.  I'm unfamiliar with htaccess, but I created one with the intention of forcing download of pdf files.  Instead, it created a server access problem.  Please advise.htaccess.txt
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ddantes

ASKER

Thank you for your participation.  Here's a screen shot.  The error happens when I try to access the pdf, if htaccess is in the same directory.User generated image
Avatar of ddantes

ASKER

I think this is an issue for my web host.  If I place the .htaccess file in other directories which contain pdf files, the "save/open" dialog is triggered by accessing the pdf.  The server error happens only in a particular folder, which is in my secure website.  I'll check the error log and discuss with web host.