Bug #18162: FTP_ASCII format ignored in the function ftp_fget()
| From: | olivier_amos at yahoo dot fr | Date: | Thu, 04 Jul 2002 11:56:05 +0000 |
| Subject: | Bug #18162: FTP_ASCII format ignored in the function ftp_fget() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-13104@lists.php.net to get a copy of this message | ||
From: olivier_amos@yahoo.fr
Operating system: Windows NT and 2000
PHP version: 4.2.0
PHP Bug Type: FTP related
Bug description: FTP_ASCII format ignored in the function ftp_fget()
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 bug report at http://bugs.php.net/?id=18162&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18162&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18162&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18162&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18162&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18162&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18162&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18162&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18162&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18162&r=globals