Hi, i want to obtain the headers for this link

http://freedfd.googlecode.com/files/FreeDFD-1.1.zip

i set up this config for curl:

$ch = curl_init();
  curl_setopt ($ch, CURLOPT_URL, $url);
        curl_setopt ($ch, CURLOPT_HEADER, true);
        curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE
5.01; Windows NT 5.0)");
        curl_setopt ($ch, CURLOPT_NOBODY, 1); // and *only* get the header
        curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 15);
        curl_setopt ($ch, CURLOPT_CUSTOMREQUEST, 'HEAD');
        curl_setopt ($ch, CURLOPT_FRESH_CONNECT, 1); // don't use a cached
version of the url
        $resultado = curl_exec($ch);
        $error = curl_error($ch);
        $info = curl_getinfo($ch);

i dont want the file, just the headers, so i set NOBODY to 1, the problem is
that if i set it Google Servers return an error page. but if i dont set it i
receive the rights headers.

I dont want the body since is a file and can be so big and i just want to
verify if the link is working.

Some idea of how to cancel the download when headers are received?

Arnold

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to