Announcements
No record found.
Hi,
In D365 Finance and Operations, user can attach multiple files to a document. I am trying to find out what would be the best way to find the file sizes of these documents.
I can access the documents using the DocuRef table and get the file stream using DocumentManagement::getAttachmentStream(), but is there a better way to directly get the file size instead of reading the stream ?
Hi Pragun,
Well thats the best option. To get the size in MB you can use following:
Stream.Length/( 1024 * 1024)
Thanks for your response Sumit.
So as I understand there is no file size stored by default and the only option is to read the file using a stream.
If your files are stroed in Azure blobs, an alternative solution would be breaking the abstraction and getting the size through Azure Storage API: BlobItem.Properties.ContentLength.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 613
André Arnaud de Cal... 455 Super User 2026 Season 1
Syed Haris Shah 292 Super User 2026 Season 1