_setImage
Sets the photo for a User profile.
Parameters
id
The id of the user.
Filedata
The data of the inserted image.
filename
The name of the image file.
Example
FM_api(
'User_setImage',
['id' => '92568',
'Filedata' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==',
'filename' => 'red_dot.png'
]
);
Results:
On Success
{"ok":1}
On Failure
{"error":"failed to create image. please check file and upload again"}
Occurs when you try to upload a file that's not an image, example used here is a text file named "test.txt".
Last updated