The process of building custom solutions for SharePoint Server.
SharePoint 2016 error 500 (internal server error)
Hello Everyone, i am facing an issue with Sp16 when i upload many documents using rest API. when i upload many documents each one is 20mb i am receiving error 500 Internal server error.
any idea about this error and how to solve it?
i tried this https://www.vioreliftode.com/index.php/how-to-make-sharepoint-2016-not-fail-long-running-uploads-large-files/ but it didn't work for me. any other suggesstions?
my post request is below
public async Task<bool> Save(string requestUri, HttpContent content)
{
var credential = new System.Net.NetworkCredential(
username,
password,
domain);
using (var handler = new HttpClientHandler() { Credentials = credential, UseProxy = false })
{
using (var client = new HttpClient(handler))
{
client.DefaultRequestHeaders.Accept.Clear();
var mediaType = new MediaTypeWithQualityHeaderValue("application/json");
mediaType.Parameters.Add(new NameValueHeaderValue("odata", "nometadata"));
client.DefaultRequestHeaders.Accept.Add(mediaType);
client.DefaultRequestHeaders.Add("X-RequestDigest", await this.GetRequestDigest());
client.DefaultRequestHeaders.Add("binaryStringRequestBody", "true");
string postUrl = this.siteUrl.EndsWith("/") ? $"{this.siteUrl}{requestUri}" : $"{this.siteUrl}/{requestUri}";
this.logger.LogDebug("Executing SharePointService.Save: PostUrl={0}.", postUrl);
HttpResponseMessage response = await client.PostAsync(postUrl, content);
response.EnsureSuccessStatusCode();
this.logger.LogDebug("Executed SharePointService.Save: PostUrl={0}", postUrl);
return true;
}
}
}
Microsoft 365 and Office | SharePoint Server | Development
1 answer
Sort by: Most helpful
-
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.
4 deleted comments
Comments have been turned off. Learn more