#41352 [Opn->Fbk]: Warning: ftp_get() PORT command successful

From: Date: Fri, 11 May 2007 08:06:57 +0000
Subject: #41352 [Opn->Fbk]: Warning: ftp_get() PORT command successful
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-112525@lists.php.net to get a copy of this message
 ID:               41352
 Updated by:       tony2001@php.net
 Reported By:      guy dot vleugels at kaneka dot be
-Status:           Open
+Status:           Feedback
 Bug Type:         FTP related
 Operating System: RH9
 PHP Version:      5.2.2
 New Comment:

Is there a public FTP server (or is it possible to create one) which
demonstrates the same problem?


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

[2007-05-11 06:00:46] guy dot vleugels at kaneka dot be

To be honest, there is no real location to reproduce this possible bug,
because the website is only on our companie's intranet.

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

[2007-05-10 20:13:52] tony2001@php.net

Where can we reproduce it?

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

[2007-05-10 13:06:26] guy dot vleugels at kaneka dot be

Description:
------------
After upgrading to PHP 5.2.2 on my RH9-machine the following error
warning occurs on post-script files using ftp_get:

Warning: ftp_get() [function.ftp-get]: PORT command successful

As a result, the post-script file won't be downloaded to my machine.

If I do a downgrade to < PHP5.2.2, everything works perfectly.

Reproduce code:
---------------
	$ftpcnn = ftp_connect("ftp-server", "4559");
	
	// login with username and password
	$ftprs = ftp_login($ftpcnn, "user", "passwd");
	
	// check connection
	if( (!$ftpcnn) || (!$ftprs) )
	{
		echo "FTP connection has failed!<br />";
		exit;
	}
	
	
	// Firstly download txt-file
	ftp_get( $ftpcnn, "/mydir/txtfile", "/ftpdir/txtfileonftp", FTP_BINARY
);
	
	// ---- Do some extra stuff -----------------------
	// Get the name of the postscript-file
	$lines = file( "mydir/txtfile" );

	foreach( $lines as $line )
	{
		if( strstr($line, "!postscript") !== FALSE )	// ea. $line =
"!postscript:0::docq/doc1764.ps"
		{
			$temp = explode( ":", $line );
			
			$psfile = $temp[3];
		}
	}
	// --- End some extra stuff -------------------


	// Code which causes the warning:
	// Warning: ftp_get() [function.ftp-get]: PORT command successful.

	// Download the ps file
	ftp_get( $ftpcnn, "/mydir/psfile", $psfile, FTP_BINARY ); 
	
	// close the connection
	ftp_close( $ftpcnn );

Expected result:
----------------
// Downloading of a file specified by arguments in ftp_get()

Actual result:
--------------
Warning: ftp_get() [function.ftp-get]: PORT command successful

File won't be downloaded


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


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


Thread (10 messages)

« previous php.bugs (#112525) next »