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

Notifications

Announcements

No record found.

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

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
    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
    237,976 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 449 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 422 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans