【发布时间】:2021-09-16 21:28:40
【问题描述】:
感谢您的回复;
我在$snap中有图片数据,$snap的内容是这样的:
data:image/jpeg;base64,/9j/4AAA...等
我需要我的 php 文件返回 $snap 作为图像文件;当 example-image.php oppend 它应该像 example.jpg
这是我要回复的脚本:
jQuery.get(domainPath+'&getImage&site='+inputHost,function(data){
$("#screenshotData").html('<img src="data:image/jpeg;base64,'+data+'"/>');
});
上面的脚本会使用我的response来制作一个img html标签,我不能改变上面的脚本; 我的回应应该使上述脚本适用。
【问题讨论】:
-
使用
base64_decode($snap);,然后将其保存在像file.jpg这样的文件中 -
请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。