okey I made a script checking if file exist but the header I got from Curl is bad
$curl = curl_init( $url );
curl_setopt( $curl, CURLOPT_NOBODY, true );
curl_setopt( $curl, CURLOPT_HEADER, true );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $curl, CURLOPT_FRESH_CONNECT, true);
$data = curl_exec( $curl );
var_dump($data);
and it gets me response 200 while @file_headers() gets me boolean false, which is right file cant be downloaded (connection reset by peer)
i'd use file_headers but its muuuch slower than curl (checking about 10k files)
any idea how to fix curl to force it showing it correctly if file exist?
FYI curl_getinfo($curl, CURLINFO_HTTP_CODE); shows 200 too
*I mean if file is reset by peer, because cURL detects if file exist flawlessly (making Head request) while get_headers() use get request by default, is there a way to force cURL make get request?
after adding curl_setopt( $curl, CURLOPT_HTTPGET,true); When i log curl I see: * Empty reply from server, while getting "reset by peer" file but this is downloading my whole file
ok I think Ive made workaround adding curl_setopt( $curl, CURLOPT_RANGE, "1-1"); and downloading 1 byte instead getting header and if false then file does not exist or reset by peer