I'm trying to set product image while creating product programmatically(on server). The image which I'm trying to set as product image is getting uploaded after product creation but it is not setting as base/small/thumbnail image.
Using below code, first I'm initialising media gallery and then adding image.And the same set of code is working in localhost not on server.On server I've changed directory permissions as well.
... ->setMediaGallery(array('images' => array(), 'values' => array())) //media gallery initialization ->addImageToMediaGallery('full path', array('image','thumbnail','small_image'), false, false) ...
As I'm not getting any exception because image is getting uploaded. Is it because of directory/file permissions. Guys, help me to figure out what exactly the issue.