smsm
1
We tried everything to use these two methods
sendFileMessage
updateCurrentUserInfoWithProfileImage
with converting picture to file using this method: https://stackoverflow.com/a/62432112/4591364
But we get this error:
“Invalid Parameters”
So please we need a little support to answer my little question about why the request gets this error “Invalid Parameters”…
smsm
2
Code looks like this:
fetch(base64String)
.then((res) => res.blob())
.then((blob) => {
const file = new File([blob], fileName, {
type: "image/png",
});
this.sendBird.updateCurrentUserInfoWithProfileImage(user.nickname, file);
});
Tyler
3
Hi @smsm,
Welcome to the Sendbird Community.
I put together a quick example of how you might upload images via Javascript: FileUploadExample (forked) - CodeSandbox
smsm
4
Hi @Tyler
We try to upload an image that is not coming from a form…
Still can’t do it till now
Tyler
5
Hello @smsm, Could you tell me where the image is coming from so I can try and reproduce the behavior for you?
Tyler
6
@smsm,
I updated the example to use a base64 string: FileUploadExample (Base64) - CodeSandbox