Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.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 标题(“内容类型:图像/jpeg”)不工作_Php - Fatal编程技术网

Php 标题(“内容类型:图像/jpeg”)不工作

Php 标题(“内容类型:图像/jpeg”)不工作,php,Php,看完所有类似的问题,没有一种情况像我这样。 删掉所有废话后,我的代码是: <?php $file = 'Images\Bird1.jpg'; header('Content-Type: image/jpeg'); imagejpeg($file); ?> 文件类型确实是image/jpeg,我还检查了更广泛版本的代码。请帮忙 imagejpeg($file); 此函数需要资源,而不是文件名。你在找什么 readfile($file); readfile($file);

看完所有类似的问题,没有一种情况像我这样。 删掉所有废话后,我的代码是:

<?php
$file = 'Images\Bird1.jpg';
header('Content-Type: image/jpeg');
imagejpeg($file);
?>
文件类型确实是image/jpeg,我还检查了更广泛版本的代码。请帮忙

imagejpeg($file);
此函数需要资源,而不是文件名。你在找什么

readfile($file);

readfile($file);