Using PHP and CURL (unless there is a better alternative then CURL in this case), is it possible to have a php function handle the header response before downloading the file?
For example:
I have a script that downloads and processes urls supplied by the user. I would like to add a check so that if the file is not valid for my process (not a text file, too large, etc),the CURL request would be cancelled before the server wastes time downloading the file.
Update: Solution PEAR class HTTP_Request2: http://pear.php.net/package/HTTP%5FRequest2/ Gives you the ability to set observers to the connection and throw exceptions to cancel anytime. Works perfectly for my needs!