With below code
curl_setopt($ch, CURLOPT_NOPROGRESS, 0);
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, 'progress_upload');
progress_upload function will be triggered many times in a second but how can we set an interval to decrease it?
With below code
curl_setopt($ch, CURLOPT_NOPROGRESS, 0);
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, 'progress_upload');
progress_upload function will be triggered many times in a second but how can we set an interval to decrease it?
2
Answers
I believe you want to set the BUFFERSIZE (in bytes) so that it will download in larger chunks:
Note: Someone mentioned that
CURLOPT_PROGRESSFUNCTION
is deprecated, I can see that how it works changes after 5.5.0 – but nowhere can I see that this feature will be removed.You can also use a tiny trick in your body function like below