• Sean Williams 21
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
I am using REST service "/services/data/v41.0/connect/files/users/me" to upload a base64 encoded image file.  The upload works and i can see the file under the Files tab, but it is not recognised as an image file, and when downloaded it is the base64 characters.  It seems the REST upload is not converting the base64 data back into a native png graphics file.

Any idea why or how i solve this?

I am posting these headers and body:

Headers:
Content-Type: multipart/form-data; boundary=boundary_string

Body:
--boundary_string
Content-Disposition: form-data; name="entity_content";
Content-Type: application/json

{
    "title": "sean"
}

--boundary_string
Content-Type: application/octet-stream; charset=ISO-8859-1
Content-Disposition: form-data; name="fileData"; filename="image.png"
Content-Transfer-Encoding: binary

<base64 data here>
--boundary_string--
I have a requirement to scrub a users photo when they leave the company.  Unfortunately, both of the fields that hold the photo are read only, and i get error "Field is not writeable" from APEX code when i  refer to them.
Also - i cannot clear them manually using APEX data loader as they do not appear in the field listing for the USER object.  
So - i cannot update these either programatically nor manually using dataloader.

Does anyone know of a way i can do this?  Users without a photo have a value in the url path of 005 which is what i want to update these to for leavers.
We have a legal requirement to backup copies of some users chatter posts when those posts are deleted.  I have created a new trigger to write out feeditem and feedcomment objects to a custom object when they are deleted, and its working well.  It runs after delete on FEEDITEM (a chatter post basically) and FEEDCOMMENT (chatter comment on a chatter post).

Chatter post = FEEDITEM record (parent)
  > Chatter comment = FEEDCOMMENT record (child)

All works as expected, but when a chatter post is deleted in the UI (and thus the comments are deleted via cascade delete) the trigger on FEEDCOMMENT does not fire.  This appears to be documented, but is a major limitation for me.  

Can anyone suggest a workaround?
 
I have a requirement to scrub a users photo when they leave the company.  Unfortunately, both of the fields that hold the photo are read only, and i get error "Field is not writeable" from APEX code when i  refer to them.
Also - i cannot clear them manually using APEX data loader as they do not appear in the field listing for the USER object.  
So - i cannot update these either programatically nor manually using dataloader.

Does anyone know of a way i can do this?  Users without a photo have a value in the url path of 005 which is what i want to update these to for leavers.
I have a requirement to scrub a users photo when they leave the company.  Unfortunately, both of the fields that hold the photo are read only, and i get error "Field is not writeable" from APEX code when i  refer to them.
Also - i cannot clear them manually using APEX data loader as they do not appear in the field listing for the USER object.  
So - i cannot update these either programatically nor manually using dataloader.

Does anyone know of a way i can do this?  Users without a photo have a value in the url path of 005 which is what i want to update these to for leavers.
We have a legal requirement to backup copies of some users chatter posts when those posts are deleted.  I have created a new trigger to write out feeditem and feedcomment objects to a custom object when they are deleted, and its working well.  It runs after delete on FEEDITEM (a chatter post basically) and FEEDCOMMENT (chatter comment on a chatter post).

Chatter post = FEEDITEM record (parent)
  > Chatter comment = FEEDCOMMENT record (child)

All works as expected, but when a chatter post is deleted in the UI (and thus the comments are deleted via cascade delete) the trigger on FEEDCOMMENT does not fire.  This appears to be documented, but is a major limitation for me.  

Can anyone suggest a workaround?