1

I use this method to download a file

public FilePathResult downloadFile(string fileName)
{
    //Download the spreadsheet
    string path = "C:\\Users\\Johandk\\Documents\\Visual Studio 2010\\Projects\\FormValue\\" + fileName + ".xlsx";
    return File(path, "application/vnd.ms-excel", fileName + ".xlsx");
}

Is there any way I can check the download progress or even get notified when the download completes?

Thanks

Johan de Klerk
  • 2,515
  • 3
  • 25
  • 35
  • Do you need to know if the download is complete on the server side or just to notify the client the the file is ready for him? – AMember Oct 24 '12 at 11:39
  • Just need to know if the download is completed on the server side – Johan de Klerk Oct 24 '12 at 11:55
  • well you can remove the java script tag, it has nothing to do with your question. how about tapping to the page_unload event, it get fired when all of the request has been rendered. but it will not let you change anything in the response. http://msdn.microsoft.com/en-us/library/system.web.ui.control.unload(v=vs.100).aspx – AMember Oct 24 '12 at 11:59

1 Answers1

1

Detecting the File Download Dialog In the Browser

taken from this answer

Community
  • 1
  • 1
AMember
  • 3,037
  • 2
  • 33
  • 64