mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-19 06:46:45 +00:00
Use setRange()
This commit is contained in:
+1
-1
@@ -309,7 +309,7 @@ class Curl
|
||||
if (is_file($download_filename) && $filesize = filesize($download_filename)) {
|
||||
$first_byte_position = $filesize;
|
||||
$range = $first_byte_position . '-';
|
||||
$this->setOpt(CURLOPT_RANGE, $range);
|
||||
$this->setRange($range);
|
||||
$this->fileHandle = fopen($download_filename, 'ab');
|
||||
} else {
|
||||
$this->fileHandle = fopen($download_filename, 'wb');
|
||||
|
||||
@@ -102,7 +102,7 @@ class MultiCurl
|
||||
if (is_file($download_filename) && $filesize = filesize($download_filename)) {
|
||||
$first_byte_position = $filesize;
|
||||
$range = $first_byte_position . '-';
|
||||
$curl->setOpt(CURLOPT_RANGE, $range);
|
||||
$curl->setRange($range);
|
||||
$curl->fileHandle = fopen($download_filename, 'ab');
|
||||
|
||||
// Move the downloaded temporary file to the destination save path.
|
||||
|
||||
Reference in New Issue
Block a user