From f6cd2862bd7e2f8791347055a1ddff484ed56511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Mon, 1 Feb 2021 11:31:30 -0500 Subject: [PATCH] feat: #9232, add profile picture into exported zip --- src/user/jobs/export-uploads.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/user/jobs/export-uploads.js b/src/user/jobs/export-uploads.js index af2bc64e97..797ba35efb 100644 --- a/src/user/jobs/export-uploads.js +++ b/src/user/jobs/export-uploads.js @@ -71,6 +71,15 @@ process.on('message', async function (msg) { archive.pipe(output); winston.verbose('[user/export/uploads] Collating uploads for uid ' + targetUid); await user.collateUploads(targetUid, archive); + + const uploadedPicture = await user.getUserField(targetUid, 'uploadedpicture'); + if (uploadedPicture) { + const filePath = uploadedPicture.replace(nconf.get('upload_url'), ''); + archive.file(path.join(nconf.get('upload_path'), filePath), { + name: path.basename(filePath), + }); + } + archive.finalize(); } });