根据二进制文件生成图片
$filename="teststream.jpg";//要生成的图片名字
if (!empty($GLOBALS["HTTP_RAW_POST_DATA"]))
{
$jpg = gzuncompress($GLOBALS["HTTP_RAW_POST_DATA"]);//得到post过来的二进制原始数据
header("Content-Type: image/jpeg");
$file = fopen("image/".$filename,"w");//打开文件准备写入
fwrite($file,$jpg);//写入
fclose($file);//关闭
转载自:
https://blog.csdn.net/qq_36663951/article/details/75062885