SharePoint Upload File

Hi There!

I am testing some SharePoint activities and when I am trying to upload a file I can see that the file is succefully uploaded but Uipath is showing an error.

19.7.0+Branch.master.Sha.8c253d13718eed5c7db27daef6facd1fe1b0d067

Source: Upload file

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 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)

Any idea how to avoid this error?

Do you have any authentication for your share point site?? if yes then this generally occurs due to mismatch in the API Signature when you are doing a Http Post Request.

hello @carmen

500 Internal Server Error is a “server-side” error, meaning the problem is not with your PC or Internet connection but instead is a problem with the web site’s server.

you can do two things:

  1. you can retry after sometimes.
  2. try Clearing your cache and browser history. It could be possible that the page you are seeing is a cached version, so after the cache is cleared it will go away

regards
Ajay

I just notice that if in the URL I put backslash () in the end made a little difference … but also showing me an other error … and still is uploading ok the file …

this is the other error that I got …the file is there and is uploaded ok

19.7.0+Branch.master.Sha.8c253d13718eed5c7db27daef6facd1fe1b0d067

Source: Upload file

Message: File Not Found.

Exception Type: Microsoft.SharePoint.Client.ServerException

RemoteException wrapping Microsoft.SharePoint.Client.ServerException: File Not Found.
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream)
at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse()
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServer(ChunkStringBuilder sb)
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQuery()
at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
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)

was my mistake … I just was missing in the Item URL the name of the file. I misunderstood and I thought that in the Item URL I just need to put the url path where will be saved the file.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.