Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP:呈现zip文件时出现问题_Php_Zip_Rendering_Content Type - Fatal编程技术网

PHP:呈现zip文件时出现问题

PHP:呈现zip文件时出现问题,php,zip,rendering,content-type,Php,Zip,Rendering,Content Type,文件大小约为40MB。但是,下载时,大小只有几百字节。请帮忙 尝试设置内容长度: header("Content-type: application/zip"); $contents=file_get_contents($the_file); echo "$contents"; exit; 尝试设置内容长度: header("Content-type: application/zip"); $contents=file_get_contents($the_file); echo "$conte

文件大小约为40MB。但是,下载时,大小只有几百字节。请帮忙

尝试设置内容长度:

header("Content-type: application/zip");
$contents=file_get_contents($the_file);
echo "$contents";
exit;

尝试设置内容长度:

header("Content-type: application/zip");
$contents=file_get_contents($the_file);
echo "$contents";
exit;

评论是正确的;这很可能是一条错误消息,可以通过在文本编辑器中打开该文件轻松确定。我还想说,您可以更有效地使用readfile函数。请参阅第一个示例,了解一些具有标题的好代码,这些标题可以为您提供良好的下载。另外,它会将代码缩短一行

评论是正确的;这很可能是一条错误消息,可以通过在文本编辑器中打开该文件轻松确定。我还想说,您可以更有效地使用readfile函数。请参阅第一个示例,了解一些具有标题的好代码,这些标题可以为您提供良好的下载。另外,它会将代码缩短一行

那几百个字节是什么?可能是来自服务器的错误消息?日志文件怎么说?就像freddy说的,这几个字节可能是一些错误消息。打开下载的文本编辑器,看看是什么。那几百字节是什么?可能是来自服务器的错误消息?日志文件怎么说?就像freddy说的,这几个字节可能是一些错误消息。打开下载的文本编辑器,看看是什么。是的。。。我在编辑部看了。。。。出现内存超过php限制的错误消息…是的。。。我在编辑部看了。。。。出现内存超过php限制的错误消息。。。。。