Question

Get File size using robotic automation

Hi,

Is it possible to get the file size in ( MB Or KB ) for a particular attachment ( say an excel file) that is downloaded to a particular folder from a particular mail?

Regards,

Shivanshu

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
December 29, 2017 - 9:01am

Yes. The OpenSpan.Office.MicrosoftOutlookMail item has a property named "Attachments". This is a collection of OpenSpan.Office.MicrosoftOutlookAttachment objects. This object has a property named "Size". This is the size in bytes of the attachment. Once you have saved it to disk, you can also get the size by writing a script using the FileInfo class to get the length (which is the size in bytes). Here is a screenshot of the latter method.

Comments

Keep up to date on this post and subscribe to comments

Pega
December 29, 2017 - 9:01am

Yes. The OpenSpan.Office.MicrosoftOutlookMail item has a property named "Attachments". This is a collection of OpenSpan.Office.MicrosoftOutlookAttachment objects. This object has a property named "Size". This is the size in bytes of the attachment. Once you have saved it to disk, you can also get the size by writing a script using the FileInfo class to get the length (which is the size in bytes). Here is a screenshot of the latter method.