Notifications
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 449 Super User 2025 Season 2
Martin Dráb 422 Most Valuable Professional
BillurSamdancioglu 239 Most Valuable Professional