Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Drupal 7 使用Drupal中的服务注册配置文件图片_Drupal 7_Drupal Services - Fatal编程技术网

Drupal 7 使用Drupal中的服务注册配置文件图片

Drupal 7 使用Drupal中的服务注册配置文件图片,drupal-7,drupal-services,Drupal 7,Drupal Services,我一直在尝试使用Service3在用户注册期间上传一张用户档案图片,到目前为止,我没有任何运气。我测试了在“picture”字段中通过硬编码的fid,还尝试了通过“filemime”、“filename”等字段,但这两个字段都不起作用。 知道我需要填充哪些字段吗 我想一定和这篇文章有关 但是它既没有答案也没有答案。我使用以下代码- //Picture is first uploaded from ios using file service and fid is passed in $data

我一直在尝试使用Service3在用户注册期间上传一张用户档案图片,到目前为止,我没有任何运气。我测试了在“picture”字段中通过硬编码的fid,还尝试了通过“filemime”、“filename”等字段,但这两个字段都不起作用。 知道我需要填充哪些字段吗

我想一定和这篇文章有关 但是它既没有答案也没有答案。

我使用以下代码-

//Picture is first uploaded from ios using file service and fid is passed in $data object
$file_contents_object = file_load($data->picture_fid);
$file_contents_array['fid'] = $file_contents_object->fid;
$file_contents_array['uid'] = $file_contents_object->uid;
$file_contents_array['filename'] = $file_contents_object->filename;
$file_contents_array['uri'] = $file_contents_object->uri;
$file_contents_array['filemime'] = $file_contents_object->filemime;
$file_contents_array['filesize'] = $file_contents_object->filesize;
$file_contents_array['status'] = $file_contents_object->status;
$file_contents_array['timestamp'] = $file_contents_object->timestamp;
$file_contents_array['rdf_mapping'] = $file_contents_object->rdf_mapping;
//use your cck field here
$user_obj->field_user_profile_picture['und'][0] = $file_contents_array;
希望这会有所帮助