Bug #18162 Updated: FTP_ASCII format ignored in the function ftp_fget()

From: Date: Sun, 07 Jul 2002 00:42:49 +0000
Subject: Bug #18162 Updated: FTP_ASCII format ignored in the function ftp_fget()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13344@lists.php.net to get a copy of this message
 ID:               18162
 Updated by:       sniper@php.net
 Reported By:      olivier_amos@yahoo.fr
-Status:           Open
+Status:           Feedback
 Bug Type:         FTP related
 Operating System: Windows NT and 2000
 PHP Version:      4.2.0
 New Comment:

Please try this snapshot:

http://snaps.php.net/win32/php4-win32-latest.zip



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

[2002-07-04 07:56:04] olivier_amos@yahoo.fr

There is a bug with the FTP_ASCII format in the function ftp_fget().
FTP_ASCII seems to be ignored because files downloaded with
ftp_fget($stream, $fp, $rf, FTP_ASCII) are in binary format
(FTP_BINARY)instead of ascii format.
You can verify it with Windows Notepad editor: in binary format,
textsfiles show "squares" instead of "end lines".

Script example:
$list = ftp_nlist($stream, '.');
while(list($k, $v) = each($list)) 
{
	$fp = fopen("$directory/$v", 'w');
	if (is_resource($fp))
		ftp_fget($stream, $fp, $v, FTP_ASCII);
	fclose($fp);
}


Does somebody know a solution to force FTP get in ASCII mode?

thanks a lot!
olivier

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


-- 
Edit this bug report at http://bugs.php.net/?id=18162&edit=1



Thread (5 messages)

« previous php.bugs (#13344) next »