fix emoji donwloadStream

This commit is contained in:
2026-05-14 09:39:24 +03:00
parent 21ba68dd35
commit 14684e0901
2 changed files with 13 additions and 8 deletions

View File

@@ -182,10 +182,12 @@ utils.downloadGridFSByName = async function (context, collection, filename, dest
const bucket = context.rocketchat.gridFsBucket(collection.collectionName)
const destStream = fs.createWriteStream(dest)
bucket.openDownloadStreamByName(filename).pipe(destStream)
const downloadStream = bucket.openDownloadStreamByName(filename)
downloadStream.pipe(destStream)
return new Promise((resolve, reject) => {
destStream.on('finish', resolve)
destStream.on('error', reject)
downloadStream.on('error', reject)
})
}