note 92441 added to function.copy

From: Date: Fri, 24 Jul 2009 08:25:35 +0000
Subject: note 92441 added to function.copy
Groups: php.notes 
Request: Send a blank email to php-notes+get-158678@lists.php.net to get a copy of this message
When you are using CURLOPT_FILE to download directly into a file, don't forget to close the resource given to curl_setopt otherwise the file will be corrupted until the end of the script's execution : <?php $ch = curl_init('http://foo.bar/foo.txt'); $fh = fopen('/tmp/foo.txt', 'w+); curl_setopt(CURLOPT_FILE, $fh); curl_exec($fh); curl_close(ch); fclose($fh); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 80.13.22.90 ---- Manual Page -- http://www.php.net/manual/en/function.copy.php Edit -- https://master.php.net/note/edit/92441 Del: integrated -- https://master.php.net/note/delete/92441/integrated Del: useless -- https://master.php.net/note/delete/92441/useless Del: bad code -- https://master.php.net/note/delete/92441/bad+code Del: spam -- https://master.php.net/note/delete/92441/spam Del: non-english -- https://master.php.net/note/delete/92441/non-english Del: in docs -- https://master.php.net/note/delete/92441/in+docs Del: other reasons-- https://master.php.net/note/delete/92441 Reject -- https://master.php.net/note/reject/92441 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#158678) next »