Search code examples
phpinternet-explorer-6

IE6 downloaded files cannot be opened unless saved to disk first


I've read lots of information on the web regarding this and and plenty on stack overflow. Sadly, nothing worked.

Symptoms:

  • IE6 only, on a Citrix Metaframe system...
  • Download prompt appears, open the file, file not found, wathever the application
  • Download prompt appears, save the file, file can be opened

Hints/information i know of:

  • I roll back to a previous version of my code, and ie6 can download
  • Tried to find the differences in code, none that output anything different per se
  • Two headers changed:
    • Cache-Control: from "proxy-revalidate" to "no-cache, must-revalidate"
    • Set-Cookie: large value, session started now on each page

What i tried:

  • Tried forcing the cache-control header to proxy-revalidate
  • Removed the login script from the workflow of file downloads, this way the set-cookies don't happen again

I'm really stuck at all this, i have no way of finding out why IE6 only cannot download files in this new version, i've done all i could and worked on this issue for hours without having more clues.

If you have any information or more hints i could look at, could be really helpful, thanks!

Edit #1

File types are any types possible, but my tests are around: text/plain, application/pdf, Outlook message files


Solution

  • You can try header('Content-Type: application/force-download');. This may help you.