I need help to upload file (Image) through Cloud Function. Now i receive an error message, ""error": "Cannot read properties of undefined (reading 'Symbol(Symbol.asyncIterator)')" with base64 technique.
my code is: // Decode the base64-encoded image const base64Data = profilePicture.replace(/^data:image/\w+;base64,/, ""); const buffer = Buffer.from(base64Data, 'base64');
// Save the decoded image as a file const filePath = path.join('/tmp', ${ID.unique()}.png); fs.writeFileSync(filePath, buffer); const fileStream = fs.createReadStream(filePath);
//Save file to storage const uploadedFile = await storage.createFile(teacherImageBucketId, ID.unique(), fileStream);
I need help to upload file (Image) through Cloud Function. (Node js)
Recommended threads
- router_deployment_not_found
I updated my function a few times and now i am getting the error: router_deployment_not_found I even reverted back to my original code but i am still getting th...
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- [Beginner] CLI --queries Syntax Error & ...
Hi everyone! I am a beginner with Appwrite and trying to use the CLI, but I'm stuck with a syntax error. Any guidance would be greatly appreciated! 🙏 **Enviro...