is it possible to both return a file for download and update a view from a controller method call?
or a workaround is needed, maybe using javascript (calling a refre
You can return the address of file using ViewModel or ViewData from your action, and use window.location.href as demonstrated in the following code at the end of your view.
Controller
public ActionResult Index()
{
/* ... */
ViewBag.FileName = "{FileName}";
return View();
}
public ActionResult Download(string id) {
/* ... */
return File("{Path}", "{MIME type}", "{Desired file name}");
}
Markup