Skip to content
Back

React native app: AppWrite storage uploaded file is empty

  • 0
  • React Native
lintaolu_04310
26 Feb, 2025, 22:21

Hi AppWrite team, I generated a file using uri, here is the code:

TypeScript
 const fetchResponse = await fetch(asset.uri);
 const blob = await fetchResponse.blob();
 const file = new File([blob], asset.fileName, { type: asset.type });

then upload the file using createFile method:

TypeScript
const response = await storage.createFile(
      bucketMap.get(bucketName), 
      ID.unique(),
      file,
    );

the file is uploaded, how ever, it is empty, see first image.

I checked the request in AppWrite SDK , and found this, see image2. I'm not familiar with request format but it seems to be fine and the file is included in the request.

Can you please help to resolve the issue? Also let me know if you need additional information.

Related unresolved question: https://appwrite.io/threads/1268920149365231768.

TL;DR
React native app developers are uploading a file using AppWrite storage, but it's turning out empty. They've verified the request and it seems correct. They seek assistance in resolving this issue. Solution: Ensure file upload process with Appwrite storage is accurately configured.
lintaolu_04310
26 Feb, 2025, 22:26

React native app: AppWrite storage uploaded file is empty

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more