0
我正在创建接收base64编码图像代码的magento api。 从api边我收到该字符串。现在我必须转换该图像代码并保存到所需的目的地。 如何在magento中实现这一点2.可以从该编码的图像中获取该图像名称。请为此提供帮助。 我有一个代码将基础64转换为在PHP中的图像。但我想知道同样的代码是否工作在Magento evnvironment如何将base64代码转换为magento中的图像2
function base64_to_jpeg($base64_string, $output_file) {
$ifp = fopen($output_file, "wb");
fwrite($ifp, base64_decode($base64_string));
fclose($ifp);
return($output_file);
}
$image = base64_to_jpeg($my_base64_string, 'tmp.jpg');