The header function is a lot of useful in php. Next I will introduce how to use the header function in php to download files using Chinese Characters in different browsers. The header function is a lot of useful in php. Next I will introduce how to use the header function in php to download files using Chinese Characters in different browsers.
Script ec (2); script
Add the following code to the downloaded file.
The Code is as follows: |
|
$ Name = rawurlencode ($ filename ); Header ("Content-type: text/plain; charset = UTF-8 "); Header ("Content-Type: application/force-download "); Header ("Content-Type: application/octet-stream "); Header ("Content-Type: application/download "); Header ('content-Disposition: inline; filename = "'.w.name.txt .'"'); Header ("Content-Transfer-Encoding: binary "); Header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT "); Header ("Last-Modified:". gmdate ("D, d m y h: I: s"). "GMT "); Header ("Cache-Control: must-revalidate, post-check = 0, pre-check = 0 "); Header ("Pragma: no-cache "); |