Options All -Indexes AddType application/octet-stream .pdf Code (markup): the force download is not working for the pdf file , so what is wrong with this file ?
In order to force downloading of a file you will need to use the Content-Disposition header, which tells the browser what to do with the file. The most common way of setting this header is by using a download script - here's a simple one I whipped up just for you (released into public domain): <?php $file=$_REQUEST['file'].'.pdf'; if(file_exists($file)==false){die;} if(strstr($file,'..')!=false || substr($file,0,1)=='/'){die;} # security measure header('Content-disposition: attachment; filename='.basename($file)); header('Content-type: application/octet-stream'); header('Content-Length: '.filesize($file)); readfile($file); ?> PHP: upload above script into your download directory and name it pdf.php. change links to your pdf files like so: my-pdf-file.pdf -- becomes -- pdf.php?file=my-pdf-file --- If you don't want to use a script there may be a way to send the needed Content-Disposition header using the Header directive from the mod_headers module - just add it to the .htaccess file you already have: Options All -Indexes AddType application/octet-stream .pdf Header set Content-Disposition "attachment; filename=file.pdf" Code (markup): Note that this 2nd method won't work if you have non-pdf files in the directory / subdirectory. Just be sure not to do both methods!
actually i found a way to make the htaccess works but except IE ? this is it Options All -Indexes <FilesMatch "\.(?i:pdf)$"> ForceType application/octet-stream Header set Content-Disposition attachment </FilesMatch>[B][/B] Code (markup):