TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Myh
NA
198
1.6k
SharePoint 2016 500 (Internal Server Error) When uploading
Mar 12 2021 10:52 PM
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
;
}
}
}
Reply
Answers (
1
)
Array, loop, what # am I on?
Can't able to send json data to C# api in winform