Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting Namecheap.com - Cheap domain name registration, renewal and transfers - Free SSL Certificates - Web Hosting

Posts Tagged ‘download file’

ie+SSL issue on PHP header for downloading file


2010
Apr 14

If you use SSL, ie will get issue when download file if the PHP header using

header(“Cache-Control: no-cache, must-revalidate”);
header(“Pragma: no-cache”);

When you click the file you want to download, ie will prompt:
“Internet Explorer was unable to open this site.The requested site is either unavailable or cannot be found.Please try again later”

Here is the link talk about this:
http://support.microsoft.com/kb/323308

However, we just need to do some modifications on PHP header and it can actually work.

Here is the PHP header modification:

header(“Content-type: application/octet-stream”);
header(“Content-Disposition: attachment; filename=YOUR_OWN_FILE”);
header(“Cache-Control: private, must-revalidate”);

It should work even on ie now!
header(“Pragma: private”);