0

I am using the Microsoft Graph SDK to integrate with a OneDrive Business account. I have uploaded large size files to the drive. The drive is syncing to the local folder. I have a requirement to download files using the Grpah SDK. If the file that needs to be downloaded is synced to the local folder, i need to retrieve that file or else download from the server.

Is there any API method where I can check if the file has been synced to the local folder?

I was referring to the https://learn.microsoft.com/en-us/graph/api/driveitem-delta?view=graph-rest-1.0&tabs=csharp link but it did not contain any information to check the local folder. I am not sure what the delta function is returning.

var delta = await _graphClient.Me.Drive.Root
                        .Delta()
                        .Request()
                        .GetAsync();

I expect an API output which says if the file is synced to the local folder or not.

1 Answers1

0

The service does not know what clients are syncing the files - there can be many. Your app would need to understand that there's a local copy, and manually check for the presence of the file in question in that location before falling back to the cloud.

Brad
  • 4,089
  • 2
  • 16
  • 26
  • Hi Brad, Thanks for the response. Do you know of a Graph API method which will sync the files to the local folder when invoked? – Zehan Jurangpathy Aug 01 '19 at 03:01
  • There are APIs that will give you the information that you need (e.g delta and the download URLs) but you'll need to write the code on the client to materialize that onto the local file system. Here's another answer I wrote on the subject: https://stackoverflow.com/questions/42315220/correct-way-to-use-onedrive-api-to-sync-files/42474335#42474335 – Brad Aug 01 '19 at 15:53
  • Thanks Brad for the detailed response. Yes i need to think of a hybrid solution for my requirement. – Zehan Jurangpathy Aug 02 '19 at 03:49