I have a MVC project, in my View i got a link to a Method in my Controller that returns a downloadable file.

My Method download data from various APIs and process the data to a file. This method takes 10-15min to complete.

I want to show progress in my View, what is the best way to do this? Should i use global variables in my controller that my method sets, and use async javascript loops to get these values?

Is there any good way to get progress from the api requests, i use the following methods for that:

    var httpWebRequest = (HttpWebRequest)WebRequest.Create(DataValues.xx + "url/" + label + "/" + UUID + "?action=" + act);
    httpWebRequest.ContentType = "application/json";
    httpWebRequest.Method = "PUT";
    httpWebRequest.Credentials = new NetworkCredential(DataValues.user, DataValues.password);
    httpWebRequest.PreAuthenticate = true;

Related posts

Recent Viewed