Skip to content

Commit

Permalink
Merge pull request #957 from bcgov/main-DV-FOIMOD-3127
Browse files Browse the repository at this point in the history
attachment MSG size and lastModified updated
  • Loading branch information
divyav-aot authored Apr 26, 2024
2 parents ed71a0d + b8397e3 commit 9adcf21
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions MCS.FOI.S3FileConversion/MCS.FOI.MSGToPDF/MSGFileProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,20 @@ public MSGFileProcessor(Stream sourceStream)
filename = Path.GetFileNameWithoutExtension(filename) + '1' + extension;
}
fileNameHash.Add(filename, true);

var lastModified = _attachment.LastModificationTime.ToString();
var sentOn = _attachment.SentOn.ToString();
if (!string.IsNullOrEmpty(sentOn))
lastModified = sentOn;

var attachmentSize = attachmentStream.Length.ToString();
if (string.IsNullOrEmpty(attachmentSize))
attachmentSize = attachmentStream.Capacity.ToString();

attachmentInfo.Add("filename", _attachment.FileName);
attachmentInfo.Add("s3filename", filename);
attachmentInfo.Add("size", attachmentStream.Capacity.ToString());
attachmentInfo.Add("lastmodified", _attachment.LastModificationTime.ToString());
attachmentInfo.Add("size", attachmentStream.Length.ToString());
attachmentInfo.Add("lastmodified", lastModified);
attachmentInfo.Add("created", _attachment.CreationTime.ToString());
attachmentsObj.Add(attachmentStream, attachmentInfo);
}
Expand Down

0 comments on commit 9adcf21

Please sign in to comment.