ID: 10860
Updated by: derick
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: cURL related
Operating system: 
PHP Version: 4.0.4pl1
Assigned To: 
Comments:

Should be fixed in CVS (by Sterling):

Try the latest cvs of cURL and set the CURLOPT_BINARYTRANSFER option
along with the CURLOPT_RETURNTRANSFER option.

please reopen if this does not work.

Derick

Previous Comments:
---------------------------------------------------------------------------

[2001-05-14 16:17:03] [EMAIL PROTECTED]
I noticed a while ago that CURLOPT_RETURNTRANSFER added trailing null chars to the end 
of html pages, which seemed odd, but didn't seem like a bug.  Then I noticed that on 
binary files, in fact what it does is REPLACE the trailing char with a null char.

Oddly, setting CURLOPT_HEADER to 1 seems to fix the problem.

<?
                $f = fopen('/tmp/bla1','w');
                $ch = curl_init();
                curl_setopt($ch, 
CURLOPT_URL,"http://www.php.net/gifs/small_submit.gif";);
                curl_setopt($ch, CURLOPT_FILE,$f);
                curl_exec($ch);
                curl_close($ch);
                rewind($f);
                fclose($f);

                $ch = curl_init();
                curl_setopt($ch, 
CURLOPT_URL,"http://www.php.net/gifs/small_submit.gif";);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                $ret = curl_exec($ch);
                curl_close($ch);

                $f = fopen('/tmp/bla2','w');
                $ret = fwrite($f,$ret,strlen($ret));
                fclose($f);
                
                system('diff /tmp/bla2 /tmp/bla1');
?>

---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10860&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to