diff --git a/.changeset/tame-stingrays-hug.md b/.changeset/tame-stingrays-hug.md new file mode 100644 index 00000000000..5f648cddede --- /dev/null +++ b/.changeset/tame-stingrays-hug.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixes an issue where files containing exif data would fail to upload to S3 when `Message_Attachments_Strip_Exif` is enabled. diff --git a/apps/meteor/app/api/server/v1/rooms.ts b/apps/meteor/app/api/server/v1/rooms.ts index 0cecf5af2d3..b4d30d8cb0c 100644 --- a/apps/meteor/app/api/server/v1/rooms.ts +++ b/apps/meteor/app/api/server/v1/rooms.ts @@ -211,6 +211,7 @@ API.v1.addRoute( if (stripExif) { // No need to check mime. Library will ignore any files without exif/xmp tags (like BMP, ico, PDF, etc) fileBuffer = await Media.stripExifFromBuffer(fileBuffer); + details.size = fileBuffer.length; } const fileStore = FileUpload.getStore('Uploads'); @@ -289,6 +290,7 @@ API.v1.addRoute( if (stripExif) { // No need to check mime. Library will ignore any files without exif/xmp tags (like BMP, ico, PDF, etc) fileBuffer = await Media.stripExifFromBuffer(fileBuffer); + details.size = fileBuffer.length; } const fileStore = FileUpload.getStore('Uploads');