Magento Forum

   
add image problem
 
gryfja
Jr. Member
 
Total Posts:  15
Joined:  2009-01-07
 

hi
i’ve got in html form input type=file what’s name pic1
i want to update images of product via api

file=>array(
//’content’ => base64_encode(file_get_contents($_FILES[’pic1’][’name’])),
‘content’ =>base64_encode(file_get_contents($_FILES[’pic1’][’tmp_name’])),
‘mime’ => ‘image/jpeg’,
‘name’ => ‘image_filename’
),
‘label’ => ‘nic’,
‘position’ => 0,
//’types’ => array(’image’, ‘small_image’, ‘thumbnail’),
‘types’ => array( ‘small_image’),
‘exclude’ => 0
);
try
{ //fclose($fhandle);
$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