I am using xml-rpc to create new employee in Odoo, what I did so far is sending employee name and now I am trying to send and upload employee image to Odoo as well using xml-rpc. I have a php page that connected with Odoo.
<?php>
........
........
........
........
$id = $models->execute_kw($db, $uid, $password,
'hr.employee','create', array(array('name'=>$_POST['name'], 'image'=>$_POST['image'])));
?>
I do not know how to do it .I added this line 'image'=>$_POST['image'] but it does not work.
You can write as following :
<?php>
........
........
........
........
$b64image = base64_encode(file_get_contents('your image path'));
$id = $models->execute_kw($db, $uid, $password,
'hr.employee','create', array(array('name'=>$_POST['name'], 'image'=>$b64image)));
?>