admin管理员组

文章数量:1201362

I am uploading the document in MSTeams channel, with below C# code,

var uploadedFile = await graphClient.Groups[teamId].Drive.Items[channelId].ItemWithPath(fileName).Content.Request().PutAsync<DriveItem>(fileStream);

but when I am trying to access this uploaded document from MS team with sharepoint url, it gives me error for next 30min minutes- You need permission to access this item. After 30 min I can access this document. I have tried multiple ways to access this uploaded document immediately but no luck. I tried-

1. var updatedFile = await graphClient.Groups[teamId].Drive.Items[channelId].ItemWithPath(fileName).Request().UpdateAsync(new DriveItem());

2. var fileItem = await graphClient.Groups[teamId].Drive.Items[channelId].ItemWithPath(fileName).Request().GetAsync();

3. var permission = await graphClient.Groups[teamId].Drive.Items[channelId].ItemWithPath(fileName)
         .CreateLink("view") // Generate a "view" link
         .Request().PostAsync();

Expectation is, when I upload document and access through sharepoint URL then it must be accessible immediately not after 30min. Kindly suggest solution if any.

Some blogs says, Is it true?- This issue usually happens due to a delay in permission synchronization between Microsoft Teams and SharePoint (where Teams stores files). When a new team is created in Microsoft Teams, its associated SharePoint site and permissions may take some time to fully propagate.

Ref-

本文标签: cUnable to access newly uploaded document in sharepoint for 30minStack Overflow