React-Native Error when Uploading File Social SDK

I’m trying to upload a file to the Social SDK. I’m basing my code on your React Native Sample App. And I’m getting the following error:

Code:

const filename =
			const response = await fetch('file://' + newFile)
			const blob = await response.blob()
			const fileObject = {
				...blob,
				name: 'profilepic.jpeg',
				uri: 'file://' + newFile,
				type: 'image/jpeg'
			};
			const data = new FormData() as any;
			data.append('file', fileObject);
			data.getAll = data.getParts;
			const query = createQuery(createFile, data);
			runQuery(createQuery(createFile, data), ({ data: fileData, error }) => {
				if (fileData) {
					console.log(fileData)
				} else if (error) {
				  console.log(error);
				}
			  });

Result:

{
    "status": "error",
    "message": "Input file contains unsupported image format",
    "code": 500000,
    "data": {}
}

Hi @dlartor please have a look at this code sample Amity-Social-Cloud-React-Native-Sample-App/AddFile.tsx at 5ee8a7163f9e7a27fb9f712787c22415d3a018aa · AmityCo/Amity-Social-Cloud-React-Native-Sample-App · GitHub and if you have further questions please let us know :pray::blush:

Yes I actually based my code in the code on the Sample you provide. It’s still not working

Hello @dlartor we have updated our docs here https://docs.amity.co/chat/typescript/file-handling#create-files , if you already follow this and still get the error, could you please help upload your code on git and send it to us? we will have the team to look into it :pray: