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

From: Date: Thu, 11 Jul 2002 20:32:48 +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-13877@lists.php.net to get a copy of this message
ID: 18162 Updated by: j.sarodnick@t-online.de Reported By: olivier_amos@yahoo.fr Status: Feedback Bug Type: FTP related Operating System: Windows NT and 2000 PHP Version: 4.2.0 New Comment: Quick assistance for win 2000 PHP 4.2.1 Functions: ftp_fget() and ftp_get() incorrectly under win 2000. The function run with a transfer mode parameter "1". The transfer mode specified must be either "1" for "FTP_ASCII". Previous Comments: ------------------------------------------------------------------------ [2002-07-11 08:44:46] j.sarodnick@t-online.de The same problem with the last snapshot. Error in: Version 4.3.0-dev Version 4.2.1 ignored because file download with ftp_fget() Warning: ftp_fget() expects parameter 4 to be long, string given in Server: Apache/1.3.24 OS: Windows NT and 2000 ------------------------------------------------------------------------ [2002-07-06 20:42:49] sniper@php.net Please try this snapshot: http://snaps.php.net/win32/php4-win32-latest.zip ------------------------------------------------------------------------ [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

« previous php.bugs (#13877) next »