httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Bakshi" <>
Subject Re: [users@httpd] [SOLVED] .htaccess force download not working
Date Fri, 15 May 2009 09:24:55 GMT
Matus UHLAR - fantomas wrote:
> On 15.05.09 12:21, J. Bakshi wrote:
>> I like to force download the pdf and mp3 files from a site. To achieve
>> this I have added the line in .htaccess
>> AddType application/octet-stream .pdf
>> AddType application/octet-stream .mp3
>> But it is not working with IE7, opera-9 but sometime firefox honor the
>> setting.
>> How can I make all browser to honor the setting through .htaccess setting ?
> You can not. It's up to the browser what does it do with content it fetched.
> Apparently IE7 does file type autodetection (IE is known to do that) and
> does whatever it wants.
> You could however try "Content-Disposition: attachment" header to hint the
> browser how the file should be handled.

Thanks for your hint. The following config solved my problem :-)

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

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message