1

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?

Community
  • 1
  • 1
niko craft
  • 2,893
  • 5
  • 38
  • 67
  • 1
    I am not sure this will you or not. But found some links which may help you. [https://laracasts.com/discuss/channels/laravel/run-download-in-background/replies/62988] . Also check the php version before using `CURLOPT_PROGRESSFUNCTION`. [http://php.net/manual/en/function.curl-setopt.php] – Manish Oct 03 '16 at 17:59

0 Answers0