You need to sign in to do that
Don't have an account?

How to Upload a Profile photo in base64 format For Community Users Using ConnectApi.UserProfiles.setPhoto
Am Uploading Profile Photo for Community Users in base64 format By Using ConnectApi.UserProfiles.setPhoto Method. But am getting "ConnectApi.ConnectApiException: The file you uploaded doesn't appear to be a valid image" This error, Help me to Fix this issue.
Hi @Raj Vakati
Same error am Getting
I know it is a year later however, please see solution below that I used.
HI @Ephetehe Mokgopanyane
Can you please show how to write test class for the same
@isTest(seeAllData=true)
static void testUpdateUserProfilePicture(){
String profilePicString = '/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAIBAQIBAQICAgICAgICAwUDAwMDAwYEBAMFBwYHBwcGBwcICQsJCAgKCAcHCg0KCgsMDAwMBwkODw0MDgsMDAz/2wBDAQICAgMDAwYDAwYMCAcIDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAALAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAn/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/AL+AA//Z';
Test.startTest();
updateUserProfilePic(profilePicString,UserInfo.getUserId());
Test.stopTest();
}