Home  >  Article  >  Backend Development  >  jquery怎样输出php用file_get_contents() 获取的图片文件,该如何处理

jquery怎样输出php用file_get_contents() 获取的图片文件,该如何处理

WBOY
WBOYOriginal
2016-06-13 10:11:461212browse

jquery怎样输出php用file_get_contents() 获取的图片文件
如题,我后台用如下代码输出图片文件

PHP code
header("Content-type: image/gif");echo file_get_contents('d:/img/a.gif');




前端用
JScript code
jquery $.get(url,null,function(data){     $('div').html(data);})


输出来全是图片乱码,不能输出图片,
注意 我这个图片用域名访问不到,是根目录的上一级,是个隐藏目录
请问,到底怎样才能输出来啊,急等。。。

------解决方案--------------------
还是的
设 p.php 为
header("Content-type: image/gif");
echo file_get_contents('d:/img/a.gif');


jquery怎样输出php用file_get_contents() 获取的图片文件,该如何处理

就能看到图片了
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