How to update user display picture

let fullPath =“
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:  '',
        name: 'Display picture',
        contentType: 'image/jpeg',
        size: 123115,