php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18162 FTP_ASCII format ignored in the function ftp_fget()
Submitted: 2002-07-04 07:56 UTC Modified: 2002-08-07 01:00 UTC
Votes:6
Avg. Score:4.2 ± 0.7
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:4 (80.0%)
From: olivier_amos at yahoo dot fr Assigned:
Status: No Feedback Package: FTP related
PHP Version: 4.2.0 OS: Windows NT and 2000
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: olivier_amos at yahoo dot fr
New email:
PHP Version: OS:

 

 [2002-07-04 07:56 UTC] olivier_amos at yahoo dot 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-06 20:42 UTC] sniper@php.net
Please try this snapshot:

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

 [2002-08-07 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 03:01:28 2024 UTC