diff --git a/examples/download_file_with_redirect.php b/examples/download_file_with_redirect.php new file mode 100644 index 0000000..52618e6 --- /dev/null +++ b/examples/download_file_with_redirect.php @@ -0,0 +1,13 @@ +setOpt(CURLOPT_FOLLOWLOCATION, true); +$curl->download($start_url, '/tmp/php-med-trans.png'); + +assert($final_url === $curl->effectiveUrl); diff --git a/examples/progress.php b/examples/progress.php index f51ef4b..d2a5f47 100644 --- a/examples/progress.php +++ b/examples/progress.php @@ -12,4 +12,4 @@ $curl->progress(function ($client, $download_size, $downloaded, $upload_size, $u $percent = floor($downloaded * 100 / $download_size); echo ' ' . $percent . '%' . "\r"; }); -$curl->download('https://php.net/distributions/manual/php_manual_en.html.gz', '/tmp/php_manual_en.html.gz'); +$curl->download('https://secure.php.net/distributions/manual/php_manual_en.html.gz', '/tmp/php_manual_en.html.gz');