Is there any way to get original image file from avatarFileId?

I am trying to get the community avatar file by using

const file = await FileRepository.getFile(avatarFileId);

file.fileUrl is used for the avatar, btw I also want to display this image file as banner.

But the avatar image is blurry or somehow image has been distorted, Is there any way to get the original image file?

Hi @Kamolla, thank you for the inquiry. We will check the information and update you again.

Hello @Kamolla ,

The images uploaded to our platform are being transformed to help you reduce the bandwidth on your side and propose a smoother application.

In web, what you can do is use the getFileUrlById helper and pass in a preferred size, for example:

import { FileRepository, ImageSize } from "@amityco/js-sdk"

const fileUrl = FileRepository.getFileUrlById({ fileId: file.fileId, imageSize: ImageSize.Full })

The values of ImageSize enum are: Small, Medium, Large and Full.

Let me know if that helps.

1 Like