|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Submitted: 2003-01-15 04:33 UTC Modified: 2003-01-15 05:13 UTC
From: patrick dot audemard at free dot fr Assigned:
Status: Not a bug Package: cURL related
PHP Version: 4CVS-2003-01-15 (stable) OS: WINDOWS 2000 SP3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: patrick dot audemard at free dot fr
New email:
PHP Version: OS:


 [2003-01-15 04:33 UTC] patrick dot audemard at free dot fr
WEB Server : Apache 2.0.42 with SSL enabled
PHP 4.3.1 CVS 2003-01-15-01-30
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,



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-15 05:13 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

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 07:20 UTC] patrick dot audemard at free dot fr
I tested and it worked.
Sorry, I checked but I forgot the "wb" in the fopen()...

Yours sincerely,

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 19:01:28 2024 UTC