Welcome to the new Box Support website. Check out all the details here on what’s changed.

C# Boxv2 API get file size failed

Answered
New post

Comments

3 comments

  • mwiller

     When getting the items in a folder, the API only returns a limited set of fields for each item by default (which doesn't include size).  You'll need to specifically request the fields you need if you want the size field returned, like this:

     

    var fields = new List() {
        "type",
        "id",
        "name",
        "size"
    };
    var items = await client.FoldersManager.GetFolderItemsAsync("0", 1000, autoPaginate: true, fields: fields);
    0
    Comment actions Permalink
  • KarlSo

    It works. Many thanks for your help. : D

     

     

    0
    Comment actions Permalink
  • Jeff_BMC

    This does not appear to work in the .Net Core version of the SDK.  Following the same steps, every field except Type and Id are null.  

     

    Is there a different method with the .Net Core SDK?

     

    Thanks

    0
    Comment actions Permalink

Please sign in to leave a comment.