OneDrive / samples

Contains samples, scenarios, and guidance for integrating with OneDrive and SharePoint drives, drive items, and files.
MIT License
58 stars 59 forks source link

How to pick file from frontend and download that file from python backend #62

Closed aravindarc closed 10 months ago

aravindarc commented 11 months ago

I used the samples to pick the file in the frontend. There are some details of the picked file. I want to send these details to the backend and download the file. Is there a way to do this.

JCrew0 commented 10 months ago

@aravindarc You'll want to follow the instructions here to download the item: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get_content?view=odsp-graph-online.

In the File-Picker response, you'll see siteId and listItemUniqueId. You can map those to site-id and item-id respectively in this request format: GET /sites/{siteId}/drive/items/{item-id}/content.

Make sure that you provide a proper graph auth token as well.

Hope that helps!