Closed (fixed)
Project:
Services
Version:
7.x-3.5
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Aug 2013 at 10:08 UTC
Updated:
1 Oct 2014 at 22:17 UTC
Jump to comment: Most recent
When updating a user I'm able to update all fields but the user image.
This is more or less my JSON:
User: Object
... all other untouched user data goes here ...
picture: Object
fid: "90"
filemime: "image/jpeg"
filename: "picture.jpg"
filesize: "51222"
rdf_mapping: Array[0]
status: "1"
timestamp: "1376041393"
type: "image"
uid: "1"
uri: "public://pictures/picture.jpg"
url: "http://mysite.com/sites/default/files/pictures/picture.jpg"
That I'm changing into:
User: Object
... all other untouched user data goes here ...
picture: Object
fid: "84"
filemime: "image/png"
filename: "anotherpicture.jpg"
filesize: 312487
rdf_mapping: Array[0]
status: 1
timestamp: 1376041608
type: "image"
uid: "1"
uri: "public://anotherpicture.jpg"
url: "http://mysite.com/sites/default/files/anotherpicture.jpg"
...and yeah - all other user data is updated correct this way - just not the user image.
Comments
Comment #1
marcingy commentedYou need to check what the user form in core sends and replicate that structure.
Comment #2
Morten Najbjerg commentedA quick solution for everyone who faces this problem. It is possible to attach the image using this structure instead:
Note the picture_upload instead of picture - that's basically it.
I haven't checked if this places the image twice on the server... which it probably does !?
Comment #3
kylebrowning commented