We are currently experiencing an issue with uploading and replacing a file on SharePoint using the UiPathTeam.SharePoint.Activities package in Windows Project.
Issue Summary:
Uploading a new file to SharePoint works fine. However, when we try to replace an existing file with the same name in the same document library, we receive the following error:
Here, I am connected the Sharepoint with Username and Password.
What We’ve Confirmed So Far:
The connection to SharePoint is successful.
Uploading a new file works.
File replace fails only when a file with the same name exists.
The user has Edit/Contribute permissions on the target SharePoint library.
We’ve tried using both Upload File and Create File activities.
Looking For:
Has anyone faced this issue with file replacement?
Are additional permissions or settings needed in SharePoint to overwrite files?
Is there an alternate approach or workaround?
Any insights or suggestions would be greatly appreciated!
When trying to replace an existing file on SharePoint using UiPathTeam.SharePoint.Activities, common issues include the “Overwrite” property not being set to True in the UiPath activity, the file being locked or checked out in SharePoint, or tenant-level policies preventing direct overwrites.
Solutions include:
Ensuring the “Overwrite” flag is enabled in the UiPath activity.
Handling file locks/checkouts by either checking file status, performing explicit checkout/checkin, or using a “Delete and Re-upload” workaround (though this loses version history).
Verifying SharePoint permissions beyond just “Edit/Contribute” to ensure no specific overwriting restrictions.
Considering the UiPath.MicrosoftOffice365.Activities package for SharePoint Online, which can be more robust.
As an advanced option, using the SharePoint REST API with the HTTP Request activity for more granular control.
Yes, the “Allow overwrite” property was already enabled, I had selected that option from the very beginning. However, I am still facing the same issue.
Thank you for your help and support.To answer your questions:
The “Overwrite” flag has been enabled from the very beginning of the activity, but we are still facing the issue.
Locks/checkouts, including checking file status and performing explicit checkout/check-in, appear to be correctly handled. There are no issues on that front. Regarding the workaround of “Delete and Re-upload,” I have already proposed this solution to the client; however, they have declined to proceed with it.
The “Edit/Contribute” permissions on SharePoint, ensuring there are no specific overwriting restrictions, have been confirmed as correctly configured by the IT team.
We have tried all possible options, but these require application permissions for the API. Currently, we only have delegated permissions from the client, and they have refused to grant application permissions.
Since the “Overwrite” flag is enabled and check-in/out is handled, the issue likely stems from delegated permissions. Some overwrite operations require application-level permissions, which you’re currently restricted from using.
As a workaround within delegated scope, you might explore the Microsoft Graph API via HTTP Request, but this too depends on the client’s Azure AD configuration.
Let me know if you’d like a sample for that approach.
Is there a specific reason you have considered using this package instead of Microsoft O365 package?
If not, I would suggest moving to Microsoft package as that is a quite stable package and support is also offered from UiPath on same. The sharepoint package you are using currently is a marketplace package and UiPath doesn’t offer support for same.
We were also using this package for quite some while but then we landed into a deadlock when there was no equivalent windows based version released for years. So we switched.
Also, this windows based package is released quite recently, so I am not even sure if this is a bug in the package as I have not tested upload functionality using the one.