0

I have a link to a page that downloads a PDF file.

When the user clicks the link, the browser simply shows the user the file save dialog (or whatever their save settings are) and the current page stops "loading" and the user hasn't moved.

Problem is, the PDF file takes a bit to generate/load, so the user is sort of sitting around without any indication (besides the Chrome loader on the tab) that the page is doing something.

I created a loader in my UI that shows when the link is clicked, but I have no idea how to detect that the current page has stopped "loading" due to the location it's trying to load being a downloaded file. How do I listen for this event?

Brian Leishman
  • 8,155
  • 11
  • 57
  • 93
  • I would take another approach to this; make an ajax call to the generator, let it return an answer back to the page when completed. If so offer the download link (or autostart it) in a new window – Mouser Aug 15 '17 at 14:55
  • @Mouser Yup I just couldn't find the right wording to get Google results that were actually useful, everything had to do with something else, but adding `content-disposition` to my search gave me exactly what I was looking for – Brian Leishman Aug 15 '17 at 14:57

0 Answers0