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 upload via web service error
 
nquocbao
Jr. Member
 
Total Posts:  7
Joined:  2009-02-19
 

Hi,

I got a problem when I tried to upload an image via web service. Everything runs smoothly and I get no error message, the image file (return value) is always /i/m/image.jpg BUT no image is really created (!!). I check on server folder and there is no file there, but the directory is created.

And if I use Admin Interface to upload image, everything runs perfectly. product is uploaded correctly. I think this is magento bug.

Here is my code

$image['file']['content'base64_encode(file_get_contents($path));
    
$image['file']['mime''image/jpeg';
    
$image['label''Front View';
    
$image['exclude'0;
    
$image['types'= array('image','small_image');

    if (
$client->query('call',$api,'product_media.create',array($sku,$image)))
    
{
      $image_file 
$client->getResponse();
      echo 
'create image : ' $sku ' => ' $image_file "<br/>";
      
      
$image_file_data .= $sku "," $image_file;
    
}
    
else
    
{
      
echo 'create image failed: ' $sku ' => ' $path ' : ' $client->getErrorMessage() . '<br/>';
    
}

Thanks for any of your attention smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
gryfja
Jr. Member
 
Total Posts:  15
Joined:  2009-01-07
 

I’ve got the same problem. I’m using 1.2.0.3 version

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