($数据进行编码JPG图像&然后通过下面的代码&试图将它保存图像文件夹中对其进行解码)这是图像文件夹中存储图像的正确方法?(在PHP)
$data = base64_decode($data); //decoded image
$im = imagecreatefromstring($data);
if ($im !== false)
{
header('Content-Type: image/jpg');
imagejpeg($im);
imagedestroy($im);
}
else
{
echo 'An error occurred.';
}
// storing it in image folder on
$success = file_put_contents('images/5.jpg',$im);
echo $success ? $im : 'Unable to save the file.';
你的问题很不清楚。请尝试更好地描述你的问题。 – BlitZ