I am using curl inside Controller to download a file. I would like to display a progress while file is downloading. I've read about that here: cURL download progress in PHP
these two lines are needed:
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION, 'progress');
curl_setopt($ch, CURLOPT_NOPROGRESS, false);
I've placed them inside a function in my controller but I am getting this error: curl_exec(): Cannot call the CURLOPT_PROGRESSFUNCTION
I am suspecting that it's not working because it can't call it like progress() it should call it like $this->progress(). Is that correct? How do I specify this if my assumption is correct, if not what am I doing wrong?