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
- domain verification failed
before 5 days i have added information but still verification is failed what will i do
- I'm receiving this error: "Internal curl...
I'm receiving this error "Internal curl error has occurred within the executor! Error Number: 52 Error Code: 500" multiple times. Sometimes the function is exec...
- Realtime connection with authenticated s...
I'm trying to get a realtime connection set up in Next.js, in a client side component for "chats." I have tested my code with a collection that has "any" read p...