Skip to content

How to get SharePoint file content knowing the path using Microsoft.Graph SDK 5.60.0+ #2784

@pasqualefloccari

Description

@pasqualefloccari

Hi,
I would like to get the content of a file from a SharePoint site knowing the path and I am trying to use this Graph URL:

https://graph.microsoft.com/v1.0/sites/00000000-0000-0000-0000-000000000000/drive/root:/ExcelFile.xlsx/content

I would like to do the same using GraphServiceClient and I have tried different approaches, but Root drive seems inaccessible e.g.

var fileStream = await graphServiceClient.Sites[siteId].Drive.Root.ItemWithPath(filePath).Content.Request().GetAsync();

Could you help me?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions