V
V
Valera Karmanov2020-03-10 12:38:23
css
Valera Karmanov, 2020-03-10 12:38:23

What is the easiest way to track the execution of a long code with an output to the progress bar?

Good afternoon. I need to create 4 thumbnails of different resolutions for 500 pictures (there are no problems with their creation). That's just how to make the creation of pictures in some kind of ajax with the output of how much has already been created and how much is left.
Now there is an example on EventSource, but for some reason it only works for 1 minute, and then the connection is closed, I didn’t find anything in the doc about this.
Can you please tell me the easiest way to do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
A person from Kazakhstan, 2019-07-31
@marki1404

Hear 'Front-end programmer' what needs to be adapted?

C
CorteZzZz, 2020-03-10
@CorteZzZz

Maybe not a great idea, but still.
You can use setInterval to ask a php script ajax for the number of files in the folder where thumbnails are generated and change the load bar based on the response

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question