diff --git a/apps/meteor/server/lib/dataExport/uploadZipFile.ts b/apps/meteor/server/lib/dataExport/uploadZipFile.ts index e6a76472db7f..c50984ed26bf 100644 --- a/apps/meteor/server/lib/dataExport/uploadZipFile.ts +++ b/apps/meteor/server/lib/dataExport/uploadZipFile.ts @@ -1,5 +1,5 @@ import { createReadStream } from 'fs'; -import { open, stat } from 'fs/promises'; +import { stat } from 'fs/promises'; import type { IUser } from '@rocket.chat/core-typings'; import { Users } from '@rocket.chat/models'; @@ -28,9 +28,7 @@ export const uploadZipFile = async (filePath: string, userId: IUser['_id'], expo name: newFileName, }; - const { fd } = await open(filePath); - - const stream = createReadStream('', { fd }); // @todo once upgrades to Node.js v16.x, use createReadStream from fs.promises.open + const stream = createReadStream(filePath); // @todo once upgrades to Node.js v16.x, use createReadStream from fs.promises.open const userDataStore = FileUpload.getStore('UserDataFiles'); diff --git a/apps/meteor/server/ufs/ufs-methods.ts b/apps/meteor/server/ufs/ufs-methods.ts index e111eecbceab..05228e059292 100644 --- a/apps/meteor/server/ufs/ufs-methods.ts +++ b/apps/meteor/server/ufs/ufs-methods.ts @@ -45,7 +45,7 @@ export async function ufsComplete(fileId: string, storeName: string): Promise { removeTempFile(); - rs.close(); if (err) { return reject(err);