Possible Duplicate:
Show progress for PHP long script
I have a PHP script that generates large PDF document on request. This usually takes about 1-2 minutes, and the only way it lets the user know that it is finished is by sending an email when it the whole process completes.
I would like to have some kind of a progress bar displayed to the user while the file is generated. What is the best way to approach this task? The only thing that comes to my mind is that the PDF-generating script should save data in the database (I already use MySQL in the project), and on the client-side I could include Ajax request that would poll for this progress data say every 5 seconds and display it to the user. So probably there would be two Ajax requests: one to launch the PDF-generating script and another one for the user to see the progress.
I think I can do it this way, but is there any standard way that I maybe don't know of?