#21654 [Com]: BINARIES DOWNLOADED CORRUPTION
| From: | patrick dot audemard at free dot fr | Date: | Wed, 15 Jan 2003 13:20:31 +0000 |
| Subject: | #21654 [Com]: BINARIES DOWNLOADED CORRUPTION | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-30105@lists.php.net to get a copy of this message | ||
ID: 21654
Comment by: patrick.audemard@free.fr
Reported By: patrick.audemard@free.fr
Status: Bogus
Bug Type: cURL related
Operating System: WINDOWS 2000 SP3
PHP Version: 4CVS-2003-01-15 (stable)
New Comment:
I tested and it worked.
Sorry, I checked but I forgot the "wb" in the fopen()...
Yours sincerely,
Patrick AUDEMARD
Previous Comments:
------------------------------------------------------------------------
[2003-01-15 05:13:57] moriyoshi@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
When using PHP on Windows platform it\'s generally necessary to specify
binary mode at fopen() parameter in order to write out non-text data.
But actually the data are always written as binary on CGI or CLI
version of PHP binary unless you specify text mode that is represented
as \"t\". This is a known exception.
------------------------------------------------------------------------
[2003-01-15 04:33:35] patrick.audemard@free.fr
WEB Server : Apache 2.0.42 with SSL enabled
PHP 4.3.1 CVS 2003-01-15-01-30
WINDOWS 2000 SP3
Browser IE6SP1
Script :
$ch = curl_init();
curl_setopt ($ch,CURLOPT_URL,$sitedownload.$_POST'fichier']);
curl_setopt ($ch, CURLOPT_HEADER,0);
curl_setopt ($ch,CURLOPT_PROXY,$proxy);
$fichiersigs = fopen ($_POST['fichier'], "w");
curl_setopt ($ch,CURLOPT_FILE,$fichiersigs);
$test = curl_exec ($ch);
curl_close ($ch);
If you configured PHP with Apache Module (php4apache2.dll) a binary
downloaded file (tested ZIP File) is corrupted. It seemed to convert LF
to CRLF but I'm not sure.
I tried without success :
curl_setopt ($ch,CURLOPT_CRLF,0);
If you configured PHP CGI, it works fine (I tested MD5).
I tested version 4.3.1 CVS 2003-01-14-01-30 and CVS 2003-01-15-01-30. I
think it's easy to reproduce.
Yours sincerely,
Patrick AUDEMARD
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=21654&edit=1