I have the following question and maybe someone has already implemented it and can help me, they will see in languages like PHP I can be sending in what record it goes when I upload a file and this I'm showing via a progressbar or a message of " x records of 1200 of the file miarchivo.xls ", now in .NET MVC4 I would like to do something similar, but I do not know if I can do. To receive the file I used something like this:
[HttpPost]
public async Task<ActionResult> FileUpload(HttpPostedFileBase file) {
if (file.ContentLength > 0) {
var fileName = Path.GetFileName(file.FileName);
var path = Path.Combine(Server.MapPath("~/Uploads"), fileName);
file.SaveAs(path);
// 1 - Por aquí proceso con EPPlus
// 2 - Aquí elimino el archivo
}
return Json(new { success = true, message= "Archivo almacenado de manera exitosa"},
JsonRequestBehavior.AllowGet);
}
The whole process of uploading, reading the file to send it to the SQL Server and the deleted one is ok, but I would like to show the user that his file is being processed, that a message of "Processing record #XXX of 14259 records (myfile.xls) " I do not know if you can do that in MVC, if you have to make any changes in the Controller or in the Entity Framework, the part of EF I'm handling with Async as well as the method.
Greetings.