Back

Storage buckets with csv files

  • 0
  • Android
  • React Native
  • Apple
  • Storage
jadon314
6 Oct, 2024, 16:28

Hello! I'm using React Native and Expo, trying to upload a csv file to my appwrite storage bucket, but can't seem to get it to work. Here's some example code:

const data = [{ foo: "foo" }, { bar: "bar" }]; const file = await storage .createFile(storageId, ID.unique(), data) .catch((error) => { throw error; });

I've verified that my storageId is correct, and my permissions and settings for the bucket are also correct. The above code doesn't throw any errors, but also doesn't upload anything to the bucket. I've also tried using blob and file types with:

const blob = new Blob([data], { type: "text/csv;charset=utf-8" }); const file = new File([blob], "file.csv", { type: "text/csv" });

But these either result in "Empty file passed to endpoint" errors or successfully upload the file to the bucket, but without any data inside of it. I can't seem to find any help online with csv files in buckets and any help with what I might potentially be doing wrong or what I might be missing would be greatly appreciated!

TL;DR
Developers using React Native and Expo are struggling to upload CSV files to their appwrite storage bucket. They've tried different approaches like using blobs and files but encountered errors or empty files. They ask for help on how to properly upload CSV files to the storage bucket.
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