3

I am using window.location to download a file from the web server. The process on the server to create the file takes a while and so I display a progress bar in the browser.

The code line after window.location hides the progress bar but it executes right after window.location which executes immediately, therefore the progress bar doesn't show.

How do I show the progress bar until the browser gets the file? Is there an event which fires when this happens? I would like to attach to that event and that's where I can hide the progress bar.

Addition:
The window.location is going to an asp.net MVC action method (same app) which returns a FileStreamResult.

Tony_Henrich
  • 42,411
  • 75
  • 239
  • 374
  • 3
    http://stackoverflow.com/questions/13811582/is-there-a-way-to-have-an-onload-callback-after-changing-window-location-href – Jonathan.Brink Sep 30 '15 at 01:19
  • 1
    That question didn't help. I am using window.location to go to the same domain and website. Even the beforeunload event doesn't fire because the page doesn't unload. The window.location is downloading an attachment. – Tony_Henrich Sep 30 '15 at 03:59

0 Answers0