
I've been stuck on this for way too long.
I should be downloading the file as a stream and writing to a storage bucked with that stream, but I keep getting an error. Am I creating the file correctly?
TypeScript
// Download the image directly as a stream
const imageResponse = await axios.get(output, { responseType: "arraybuffer", timeout: 10000}); // Use arraybuffer for compatibility
// Convert the array buffer to a Buffer
const imageBuffer = Buffer.from(imageResponse.data);
// Upload the image to Appwrite storage directly
const createFile = await storage.createFile(
config.bucketId, // Replace with your Appwrite storage bucket ID
ID.unique(), // Generate a unique file ID
imageBuffer, // Pass the stream directly
["user:" + account_id] // Set user-specific permissions (read/write access)
);
TL;DR
The developer is attempting to download an image file as a stream and write it to a storage bucket using Axios and Appwrite. They are converting the array buffer to a Buffer and uploading it to the storage directly. The issue may be related to how the file is being created in the bucket. Recommended threads
- "Invalid relationship value. Must be eit...
In my app i am trying to update the documents in my databse from a form in my app, and i am getting this error Error updating event users: AppwriteException: I...
- Profile Image from storage not showing (...
I am uploading a photo during register, and it is also being uploaded to appwrite storage . But in my profile screen it is showing black screen. I am attaching ...
- reoccurring resource limit usage
Two days ago I had of the error (attached) when there’s virtually no usage this month for any of my appwrite apps Yesterday we cleared up and I wasn’t getting...
