httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Bakshi" <joyd...@infoservices.in>
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
</FilesMatch>
```````````````````````````````````````````



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message