return 0;
} $range =
$size . '-' .
($totalSize - 1
);
if (!\
function_exists('curl_init'
)) { throw new Exception('PHP Extension "curl" is required to download a file'
);
} // Configuration of curl
$ch =
curl_init();
curl_setopt($ch, CURLOPT_RANGE,
$range);
curl_setopt($ch, CURLOPT_URL,
$sourceUri);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false
);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false
);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true
);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true
);
curl_setopt($ch, CURLOPT_NOPROGRESS, false
);
curl_setopt($ch, CURLOPT_PROGRESSFUNCTION,
function D
$ch,
$dltotal,
$dlnow) use ($size) { if ($dlnow > 0
) {