Update user profile picture using entity_metadata_wrapper I am trying to update the user profile picture using entity_metadata_wrapper. But I am getting 


  "Unknown data property picture." error.  


When I check the user property info, I cant see the picture field as well. Below is my example code: 

$user = entity_metadata_wrapper('user', $form_state['entity_id']);
if (isset($form_state['values']['user_profile_pic'])) {
   $file = file_load($form_state['values']['user_profile_pic']);
   $file-&gt;status = FILE_STATUS_PERMANENT;
   file_save($file);
$user-&gt;picture = $file;
}




Thanks in advance.
Try this out :



  $wrapper = entity_metadata_wrapper('user', $form_state['entity_id']);
//- Get the user object.
  $user = $wrapper->value();
  if (isset($form_state['values']['user_profile_pic'])) {
    $file = file_load($form_state['values']['user_profile_pic']);
    $file->status = FILE_STATUS_PERMANENT;
    file_save($file);
    $edit = array(
      'picture' => $file,
    );
    user_save($user, $edit);
  }