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;
- }
- }
- }