Home >Backend Development >PHP Problem >PHP download file cannot be decompressed

PHP download file cannot be decompressed

王林
王林Original
2019-10-21 10:14:143643browse

PHP download file cannot be decompressed

Reason:

The default character set of the windows system is gbk, the project uses uft8 encoding, and Chinese file names must be transcoded to use file_exists Check the file, otherwise it will report that the file cannot be found.

The solution under windows is to open the section noted above:

$file_name = iconv("utf-8","gbk//IGNORE",$file_name); // 特别注意!特别注意!
特别注意这里,windows下必须开转码,不然直接文件不存

Recommended tutorial: PHP video tutorial

The above is the detailed content of PHP download file cannot be decompressed. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn