SharePoint Upload File Activity returns error (500) if file size >100KB

I am trying to upload files to SharePoint using UIPathTeam.Sharepoint.Activities (
I know that I have set the paths correctly because tiny files are uploaded succesfully but whenever the file is bigger than 100KB, I get an error: The remote server returned an error: (500) Internal Server Error.

Looking forward to your help.

Here is my code:


Full error message:

Source: Upload output file to Sharepoint

Message: The remote server returned an error: (500) Internal Server Error.

Exception Type: System.Net.WebException

RemoteException wrapping System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
at System.Net.HttpWebRequest.GetResponse()
at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()
at Microsoft.SharePoint.Client.File.SaveBinary(ClientContext context, String serverRelativeUrl, Stream stream, String etag, Boolean overwriteIfExists, SaveBinaryCheckMode checkMode)
at Microsoft.SharePoint.Client.File.SaveBinaryDirect(ClientContext context, String serverRelativeUrl, Stream stream, Boolean overwriteIfExists)
at UiPathTeam.SharePoint.Utils.UploadFile(ClientContext clientContext, String url, String localPath, Dictionary`2 itemProperties, Boolean allowOverwrite, Boolean queryInBatch)
at UiPathTeam.SharePoint.Activities.Libraries.UploadFile.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)