2

I'm using a .htaccess file to make links to JPEGs download instead of opening in the browser window. This is what I'm using:

    AddType application/octet-stream .jpg

It's working fine in Safari and Firefox on Mac OSX but not on IE 8 on Windows. Is there any way around this apart from writing a header in PHP which I would rather not do?

user796037
  • 21
  • 1

3 Answers3

5

I think Internet Explorer does also expect Content-Disposition: attachment for downloads. If you have mod_headers available, you can do this:

<FilesMatch "\.jpg$">
    Header set Content-Disposition attachment
    Header set Content-Type application/octet-stream
</FilesMatch>
Gumbo
  • 643,351
  • 109
  • 780
  • 844
1

I found some tutorials which use another method that should work for you:

  1. Here
  2. and Here
Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
0

Add header("Content-disposition: attachment; filename=..."); in PHP

Chojny
  • 170
  • 1
  • 6