I have a long-running script that eventually outputs a file to be downloaded. What I'm trying to do is show a progress bar for that file.
Basically the logic should be:
- Start looping through objects (can be thousands)
- Echo a progress report every loop
- Flush the buffer for output to show immediately
- Use jQuery to check that content and display things accordingly
Problem is as I understand, jQuery's AJAX functions wait for the finished HTTP response (by design) so buffering won't help (as the success functions won't load until I finish completely).
How would I go about doing this? Only answers I've found are way outdated plugins that can't be found anymore.
And no - I don't mean a file upload status bar, but a script load one.