Hello Amity forum!
I would like to ask a simple question.
I can’t find where and how to set/pass the uploaded image to be full size.
I’ve tried a lot ways but when I’m getting the image it returns in a very small resolution.
Your docs describes that there is a way, but I could not find it
Uploading:
const data = new FormData();
data.append('files', file);
this.conversation.pendingFile = file;
//@ts-ignore
const { data: files } = await FileRepository.uploadImage(data);
const { fileId } = files[0];
Sending message:
const imageMessage: any = {
subChannelId: this.conversationId,
dataType: MessageContentType.IMAGE,
fileId,
text: 'this text is optional field for message image type',
caption: 'this text is optional field for message image type',
isFullImage : true,
metadata: {
isFullImage: true,
isFull: true,
},
};
try {
await MessageRepository.createMessage(imageMessage);
this.conversation.pendingFile = undefined;
} catch (error: any) {
//....
}
View image:
private async loadImage(fileId: string)
{
const image = await FileRepository.getFile(fileId);
//console.log(image)
this.img.url = image.data.fileUrl;
this.img.loading = false;
}
Thanks for any help!