What i want to do is knowa file size and not download it. I've tried it with HEAD but the server doesn't respond curl_setopt($curl, CURLOPT_NOBODY, true); if i quit this , it will , but it will download the whole file...
So if i could somehow tell curl that the max received data should not pass certain bytes and stop, or give a timeout, to not wait until the whole file is downloaded ,
In a normal download :
GET /filepath HTTP/1.1 Host: host.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:22.214.171.124) Gecko/20100625 Firefox/3.6.6 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive
HTTP/1.0 200 OK Server: Apache/ (Debian GNU/Linux) PHP/ Content-Type: application/octet-stream ETag: "MFFPJ28A" Content-Length: 3342417 Content-Disposition: attachment Cache-Control: private Content-Transfer-Encoding: binary Accept-Ranges: bytes
I tried to specify ranges from 0 to 100 for example but then i get Content-Length: 101 so no use there...