Focus:
1, in IE to download the attachment before you want to empty the cache.
2, Chinese file name to use UrlEncode encoding.
Copy Code code as follows:
Header ("Pragma:"); If not, IE will prompt the target host to be inaccessible
Header ("Cache-control:"); If not, IE will prompt the target host to be inaccessible
Header ("Content-type: $type");
Header ("Accept-ranges:bytes");
Header ("Content-transfer-encoding:base64");
Header ("Accept-length:"). FileSize ($path _c));
Header ("content-disposition:attachment; Filename= ". UrlEncode ($filename)); In IE without urlencode Chinese name will appear garbled
ReadFile ($path _c);
Exit
Or
Copy Code code as follows:
Header (' Content-description:file Transfer ');
Header (' Content-type:application/octet-stream ');
Header (' Content-disposition:attachment filename= '. UrlEncode (basename ($file));//ie without UrlEncode Chinese name will appear garbled
Header (' content-transfer-encoding:binary '); Binary Transmission
Header (' expires:0 ');
Header (' Cache-control:must-revalidate, post-check=0, pre-check=0 ');//If not, the target host cannot be accessed by IE in the header (' Pragma: Public '); If not, IE will prompt the target host to be unable to access the
header (' content-length: '. FileSize ($file));
Ob_clean ();
Flush ();
ReadFile ($file);
Exit;