0

I am playing with PHP and curl_multi_exec and I noticed that there is no way to find out whether an URL has been completly downloaded or not.

Only semi-working way I found is curl_getinfo(). If there is download_content_length I could check if the downloaded file is of the same size. However for PHP and CGI-BIN pages the download_content_length is reported as -1.

If I use curl_errno(), it not always work in case of timeouts.

Till Helge
  • 9,253
  • 2
  • 40
  • 56
Nick
  • 9,962
  • 4
  • 42
  • 80

1 Answers1

0

I found that you need to set the timeout in curl handles, not in the loop where curl_multi_exec() works.

Nick
  • 9,962
  • 4
  • 42
  • 80
  • Source code is very long, I can post it on request. – Nick Mar 19 '13 at 09:14
  • 1
    It is really ok if you want to post a question and an answer. But your answer should be really comprehensive then, because its only purpose would be to help others, who stumble upon the same problem. So please improve your answer. – Till Helge Mar 19 '13 at 09:22