Hi guys i am getting a file trough CURL and want to put up some kind of a success indicator to show if the file has been successfully downloaded or not here's my CURL logic $ch = curl_init("http://www.domain.com/getthis.zip"); $fp = fopen("savehere.zip", "w"); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_HEADER, 0); curl_exec($ch); curl_close($ch); fclose($fp); PHP: now i want to put something like if (success_logic_here) { $success = 1; } PHP: in the middle of this code .. I know that i could have written something like if (file_exists("savehere.zip")) { $success = 1;} PHP: but thats a kind of ugly way to do it .. why torture the file system if there's possibility to just check on CURL .. so which part of the CURL determines if it's successfull or not ? Thanks
Before. The cURL handle variable will be unset with curl_close(), and you need it for both of the functions above.