This is how i do it in c++
int offset = 0;
int size = 10*1024;
char range[256];
curl_slist_s *pHeaders = NULL;
snprintf(range, 256, "Range: bytes=%d-%d", offset, offset+size-1);
pHeaders = curl_slist_append(pHeaders, range);
curl_easy_setopt(pCurlHandle, CURLOPT_HTTPHEADER, pHeaders);
curl_slist_free_all(pHeaders);
pHeaders = NULL;
Edit: Just found out you meant in php. Ill see if i can find out how to port it.
Think this should work in php:
$offset = 0;
$size = 10*1024;
$a = $offset;
$b = $offset + $size-1;
curl_easy_setopt(curlHandle, CURLOPT_HTTPHEADER, array("Range: bytes=$a-$b") );
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…