| Description |
| Upload a user picture. |
| Request |
| mode | The protocol request mode: uploadpic |
| user | Username. Leading and trailing whitespace is ignored, as is case. |
| password | Password in plain-text. Either this needs to be sent, or hpassword. |
| hpassword | Alternative to plain-text password. Password as an MD5 hex digest. Not perfectly secure, but defeats the most simple of network sniffers. |
| default | 1 if this should be the user's default picture, 0 otherwise. |
| keywords | Optional. A comma-delimited list of keywords which may be used to refer to this picture. Keywords may contain spaces, but may not contain commas, to avoid interfering with LiveJournal's UI (which often displays comma-delimited lists of items). If a keyword is already in use by another image, it will be removed from that image. |
| data | Optional. Encoded image data. Either this or url must be specified, but not both. The encoding bloats the size of the data by about 2.5x, but since user images are small, we'll live. The client should enforce the image size limit (currently 40K) to avoid uploading megabytes of data (which will be rejected) if the user errs. |
| url | Optional. Image URL. Either this or data must be specified, but not both. |
| Response |
| success | OK on success or FAIL when there's an error. When there's an error, see errmsg for the error text. The absence of this variable should also be considered an error. |
| errmsg | The error message if success was FAIL, not present if OK. If the success variable isn't present, this variable most likely won't be either (in the case of a server error), and clients should just report "Server Error, try again later.". |
| picid | The ID assigned to the uploaded picture on success. If the picture is a duplicate of an existing picture, the existing picture's ID will be returned. |
| width | The width of the uploaded picture. |
| height | The height of the uploaded picture. |