How can I see all open upload sessions under a SharePoint/Team Site Folder?

Hein Moe Thu 10 Reputation points
2023-09-01T17:10:35.31+00:00

I have flows and scripts that automatically move files/folders under a SharePoint/Team Site if they meet a certain criteria. This works well except for a case in which a folder is moved while a user is still uploading files to that folder. The upload would fail because the folder no longer exists.

I would like to know if there are any ways to detect upload sessions opened under a site or folder so that the script can wait for them to complete before moving the folder.

Using the Graph API, I noticed that a when a large file is being uploaded, a driveItem of size 0 is initially created and the size changes after the upload is completed. However, I don't see a way to differentiate between a file currently being uploaded and an empty file.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,627 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,445 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,300 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Astroluna 10 Reputation points
    2023-12-01T15:39:49.91+00:00

    As of my last knowledge update in January 2022, directly detecting ongoing upload sessions in SharePoint using the Microsoft Graph API can be challenging. The observed behavior of a file's size changing after upload completion might provide an indirect signal, but distinguishing between an ongoing upload and an empty file is not straightforward. Consider exploring alternative strategies such as monitoring file changes or implementing delays before moving folders to address potential issues with ongoing uploads. Always stay updated with the latest Microsoft Graph API documentation for any new features or improvements.

    2 people found this answer helpful.
    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more