SorryLad2
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
- What if Appwrite user still try to signu...
As we mentioned here that this program is for new users, so if the old user go through this program? It doesn't sounds like a credits abuse or somehow they are ...
- Error while creating a document using No...
I developing a course app while creating a course I got this following error which appears, I try to change structure of my code but it fails. Using Nextjs ```...
- Heads up: billing page errors
In my appwrite dashboard, I tried to open the billing page but it shows nothing, opened the browser dev tools and saw some errors, tried chrome (win 10, android...