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

WBOY
Release: 2016-06-13 13:39:37
Original
795 people have browsed it

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

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

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

Copy after login




前端用
JScript code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
jquery $.get(url,null,function(data){
     $('div').html(data);
})

Copy after login


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

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


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

就能看到图片了
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template