How to update user display picture

let fullPath =“https://sscprodeuwjaar01.blob.core.windows.net/assets/jaarbeurs/icon/96ac651efdf24d5eb887d1e97c1ba962.jpg
const file = await fetch(fullPath);
const theBlob = await file.blob();
await kitty.updateCurrentUserDisplayPicture({file:new File([theBlob], “filename”)});

the result is success
but can not display the picture
please help

Hey @jaarbeurs.chatkitty, welcome to ChatKitty community!

I tried testing the code you’re using with the URL you provided, but its server is enforcing CORS for the resource so the fetch call fails.

Since it’s a publicly uploaded image, I recommended uploading it as an external file like this:

await kitty.updateCurrentUserDisplayPicture({
      file: {
        url:  'https://sscprodeuwjaar01.blob.core.windows.net/assets/jaarbeurs/icon/96ac651efdf24d5eb887d1e97c1ba962.jpg',
        name: 'Display picture',
        contentType: 'image/jpeg',
        size: 123115,
      },
    });