How can I auto download CSV file


I would like to have a CSV be downloaded automatically without the user needing to select the download button. The challenge is, fetching the data to populate the file takes several minutes and users will switch their focus to complete other work while the process is running. But, when they return, they typically find that they waited too long and the application has refreshed and reverted back to the login page. They then need to re-run the job as the original file is no longer available to be downloaded. It would be ideal if the file could just be downloaded automatically. Any ideas?

Thank you!