FTP_NLIST and FTP_RAWLIST not working! (pls help)
Posted: Thu Jun 19, 2003 4:50 pm
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:
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...
- 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);
?>ANY IDEAS??
Thank you for your time...