Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

image after upload
 
gryfja
Jr. Member
 
Total Posts:  15
Joined:  2009-01-07
 

hi. i’ve got a problem with assign image to the product after upload image. Image after upload is into /media/catalog/product/i/m/image*.jpg but is not showing up on the web site. What do i need to do to assign image to the product:

$newImage=array(
‘file’=>array(
‘content’ =>base64_encode(file_get_contents($filepath)),
‘mime’ => ‘image/jpeg’,
),
‘label’ => ‘abc’,
‘position’ => 0,
‘types’ => array(’image’, ‘small_image’, ‘thumbnail’),
‘exclude’ => 0
);
try
{
$imageFilename = $client->call($sess_id, ‘product_media.create’, array(’Sku’, $newImage));
$client->call($sess_id, ‘product_media.update’, array(
‘Sku’,
$imageFilename,
array(
‘position’ => 0,
‘types’ => array(’image’)
)
)
);
}
catch(Exception $e)
{
print("blad jpeg” . $e->getMessage() . “\n” );
}

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top