Hi Team,
I am using Kendo UI file upload control with multiple attribute set to true.
Does File Upload control handles the failed uploads on its own ?
I am using the following code snippet on the server and i am posting data through web api.
[HttpPost]
public Task Post()
{
var folderName = "Uploads";
//var PATH = HttpContext.Current.Server.MapPath("~/" + folderName);
var PATH = "C://Uploads/";
var rootUrl = Request.RequestUri.AbsoluteUri.Replace(Request.RequestUri.AbsolutePath, String.Empty);
if (Request.Content.IsMimeMultipartContent())
{
var streamProvider = new MultipartFormDataStreamProvider(PATH);
var task = Request.Content.ReadAsMultipartAsync(streamProvider).ContinueWith(t =>
{
if (t.IsFaulted || t.IsCanceled)
{
throw new HttpResponseException(HttpStatusCode.InternalServerError);
}
});
return task;
}
else
{
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotAcceptable, "This request is not properly formatted"));
}
}
I want to capture the error information for the failed files and display that information to the user.
Kendo file upload is just returning the status as Failed for the failed uploads but how we can pass the actual error information back to the user?
Thanks
I am using Kendo UI file upload control with multiple attribute set to true.
Does File Upload control handles the failed uploads on its own ?
I am using the following code snippet on the server and i am posting data through web api.
[HttpPost]
public Task Post()
{
var folderName = "Uploads";
//var PATH = HttpContext.Current.Server.MapPath("~/" + folderName);
var PATH = "C://Uploads/";
var rootUrl = Request.RequestUri.AbsoluteUri.Replace(Request.RequestUri.AbsolutePath, String.Empty);
if (Request.Content.IsMimeMultipartContent())
{
var streamProvider = new MultipartFormDataStreamProvider(PATH);
var task = Request.Content.ReadAsMultipartAsync(streamProvider).ContinueWith(t =>
{
if (t.IsFaulted || t.IsCanceled)
{
throw new HttpResponseException(HttpStatusCode.InternalServerError);
}
});
return task;
}
else
{
throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotAcceptable, "This request is not properly formatted"));
}
}
I want to capture the error information for the failed files and display that information to the user.
Kendo file upload is just returning the status as Failed for the failed uploads but how we can pass the actual error information back to the user?
Thanks