This topic is locked
[SOLVED]

 Old question implementing a progressbar

6/10/2020 9:09:41 AM
PHPRunner General questions
J
jacques author

Hello,
I have read that my question is / was not easy to solve. I read about it in the forum but haven't seen a solution yet.

I have some large files for which I would like to show a progress bar if it is processed in a php event.
Is there anyone who has found a solution or has come up with a work around?
I can not manage to do it
Thanks in advance for reading / thinking along.
gr
Jacques

Admin 6/10/2020

This can be done but is not easy and doesn't make much sense unless your process takes at least 30 seconds.
The communication needs to be done via the database. Long-running PHP code creates a record in a special table with a special ID (many processes may run at the same time so you need to know which one to track). There will be another piece of code that pulls that database record every second or so via AJAX and displays the current progress on the screen.
An experienced coder should be able to tackle this in 3-4 hours of coding depending on details.

J
jacques author 6/12/2020



This can be done but is not easy and doesn't make much sense unless your process takes at least 30 seconds.
The communication needs to be done via the database. Long-running PHP code creates a record in a special table with a special ID (many processes may run at the same time so you need to know which one to track). There will be another piece of code that pulls that database record every second or so via AJAX and displays the current progress on the screen.
An experienced coder should be able to tackle this in 3-4 hours of coding depending on details.


thank you for your answer
I solved my problem based on server-sent-events (see article)
Using server-sent events