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

marcingy’s picture

Category: bug » support

You need to check what the user form in core sends and replicate that structure.

Morten Najbjerg’s picture

A quick solution for everyone who faces this problem. It is possible to attach the image using this structure instead:

User: Object
	... all other untouched user data goes here ...
	picture_upload: 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"

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 !?

kylebrowning’s picture

Issue summary: View changes
Status: Active » Closed (fixed)