Organizational Research By

Surprising Reserch Topic

how to upload a large file with asp net mvc4 web api with progressbar using -'c#,asp.net,asp.net-mvc,asp.net-mvc-4'


how to upload a large file with asp net mvc4 web api with progressbar  using -'c#,asp.net,asp.net-mvc,asp.net-mvc-4'

how can i upload a large file with ASP.NET MVC4 Web Api
and also get a progress?

i saw this post and i understand how to handle the uploaded file but how i can get the progress data?
How To Accept a File POST - ASP.Net MVC 4 WebAPI

please don't send me links to upload products.
i want to understand how handle this in the MVC4 Web Api way...
here is an example code of handling a file upload in MVC4 WebApi

    public async Task<HttpResponseMessage> Post()
    {
        if (Request.Content.IsMimeMultipartContent())
        {
            var path = HttpContext.Current.Server.MapPath("~/App_Data");

            var provider = new MultipartFormDataStreamProvider(path);

            await Request.Content.ReadAsMultipartAsync(provider).ContinueWith(t =>
            {
                if (t.IsFaulted || t.IsCanceled)
                    throw new HttpResponseException(HttpStatusCode.InternalServerError);
            });

            return Request.CreateResponse(HttpStatusCode.OK);
        }
        else
        {
            throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotAcceptable, "This request is not properly formatted"));
        }
    }


now when

   await Request.Content.ReadAsMultipartAsync(provider)


how can i get how bytes loaded?
    
asked Sep 7, 2015 by rajesh
0 votes
21 views



Related Hot Questions



Government Jobs Opening


...