FTP_NLIST and FTP_RAWLIST not working! (pls help)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
roboyer
Forum Newbie
Posts: 1
Joined: Thu Jun 19, 2003 4:50 pm
Location: Fairbanks, AK

FTP_NLIST and FTP_RAWLIST not working! (pls help)

Post by roboyer »

Here is my set up:

- PHP 4.3.2 with IIS 5.1 (Windows XP Pro), where php files are executed.
- FTP server is Windows 2000 Server running IIS 5.

And here is my code:

Code: Select all

<?php
$conn_id = ftp_connect("FTP_SERVER", 21);
	$login_result = ftp_login($conn_id, "USERNAME", "PASSWORD");
	if ((! $conn_id) || (! $login_result)) {
		die("FTP connection failed!!");
	}
	ftp_pasv($conn_id, "True");
	ftp_chdir($conn_id, "SOME_DIR");
	$path = ftp_pwd($conn_id);
	echo "The current directory is: <STRONG>".$path."</STRONG><BR><BR>\n";	
	$contents = Array();
	echo "Contents variable is of type: <STRONG>".gettype($contents)."</STRONG><BR><BR>\n";
	$contents = ftp_rawlist($conn_id, "$path");
	echo "Now Contents variable is of type: <STRONG>".gettype($contents)."</STRONG><BR><BR>\n";
	ftp_close($conn_id);
?>
My $contents variable always turns into type Boolean (false) whenever I use NLIST or RAWLIST functions. All other PHP FTP functions seem to work just fine. I know the directory I'm trying to look at has at least four files in it.
ANY IDEAS?? :?

Thank you for your time...
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

There appears to be a long history of this bug being "fixed" and re-opened from people using IIS, See the discussion here:
http://bugs.php.net/bug.php?id=16057
curunir
Forum Newbie
Posts: 2
Joined: Tue May 10, 2005 9:04 am

Post by curunir »

Hi,

does anybody know if this problem is fixed with PHP 5 ?

Thx.
curunir
Forum Newbie
Posts: 2
Joined: Tue May 10, 2005 9:04 am

Post by curunir »

up
Post Reply