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

Archive for April, 2010

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”);

change Linux file permission recursively


2010
Apr 07

how to change files in directory let say /home/demo from permission 777 to 755?

you need to know these commands:

1. change permission
chmod -R 0755 /home/demo

2. find permission with 777
find /home/demo -perm 777 -print

Combine these two commands, you can now change all files from permission 777 to permission 755.

find /home/demo -perm 777 -print -exec chmod 755 {} \;