web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How can we get the attached document file sizes ?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

pastedimage1620902347785v1.png

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 ? 

I have the same question (0)
  • Verified answer
    Sumit Loya Profile Picture
    2,230 on at

    Hi Pragun,

    Well thats the best option. To get the size in MB you can use following:

    Stream.Length/( 1024 * 1024)

  • Pragun Saini Profile Picture
    Microsoft Employee on at

    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.

  • Verified answer
    Martin Dráb Profile Picture
    239,022 Most Valuable Professional on at

    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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 613

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 455 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 292 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans