我试图使用Magento的API来创建一个图像,但它与消息如何创建图像与Magento的API
SoapFault exception: [104] Cannot create image.
这不是一个有用的错误消息,失败!这是什么意思?它为什么这样做?如何使用magento api创建图像?
这是我的代码:
$client = new SoapClient($wsdlurl);
$sessionId = $client->login($user, $key);
$file = array(
'content' =>
base64_encode(file_get_contents($filename)),
'mime' => 'image/jpeg',
'name' => 'newfile.jpg'
);
$result = $client->call(
$sessionId,
'catalog_product_attribute_media.create',
array(
$productId,
array('file'=>$file, 'label'=>'new_test_label', 'position'=>'100', 'types'=>array('thumbnail'), 'exclude'=>0)
)
);
我在做什么错?