我有这个标签从php脚本请求图像blob
<img src="https://example.org/show_image.php?id=41" width="200" height="142">
php脚本是
$connection = @mysqli_connect($nome_host, $nome_user, $password) or die();
$in_id = (int) $_GET['id'];
$res_image=mysqli_query($connection,'SELECT content FROM image WHERE id_image='.$in_id) or die();
$image = mysqli_fetch_array($res_image);
header("Content-Type: image/pjpeg");
header("Content-Disposition: inline; filename=image.jpg");
echo $image['content'];
在迁移到php 5.6之前它工作,之后图像没有显示,浏览器注意到“Impossibile caricare l'immagine” 当我调试脚本时
wget "http://example.org/show_image.php?id=41"
图像下载正确。
谁能告诉我问题是什么?提前致谢!
我解决了问题是在脚本中的<?php
之前放置的一个字符(我的IDE看不到),这会弄脏标题