Lets say we have the standard “FileMessage” displayed like this in our cha, for this we use the “file.url” parameter. If I only wanted to send one message but attach multiple images. Is there a specific way of doing this? Or would I just attach the additional images to “data”?
Imagine this card, but with maybe 2-3 additional images inside, kind of like facebook messenger.
We’re just using the Sendbird JS SDK + VueJS, not the React UI kit for clarity
and what about the local file choosing from library?
as far as i know that, send bird will not response the uploaded images if you upload with urls file
You would simply select multiple items from the library you’re using to select the files. For example, if you were using the built in browser method, you’d select shift ctrl/cmd click multiple items.
Can you expand on what you mean by Sendbird not responding if you send multiple URLs?
We don’t provide documentation on how to grab files from your device. We do provide documentation on how to send those files once you’ve selected them:
To get the array of files. Then create as many FileMessageParams() as files selected:
// You need to send this array
const arrayParams = [];
// Check all the selected files
for (let file of files) {
const params = new sb.FileMessageParams();
params.file = file;
params.fileName = file.name;
params.fileSize = file.size;
params.mimeType = file.type;
// Add to the array
arrayParams.push(params);
}
// Send your message
channelObj.sendFileMessages(arrayParams, (fileMessage, error) => {
...
});
Here my code. but sendFileMessages , doesn’t return a callback, but still get images when reload app.
2) Why sendFileMessages =>but don’t return fileImage array instead of file ?