|
Re: PHP question, FTP and dir listings of larger sizes.
09/13/06 06:16 AM
|
|
|
> I'm ftp'ing into a server, and if I nlist the root dir consisting of a few files, I > can do it just fine. > > When I change dirs and nlist the folder with 8,000 files in it, no go. Any ideas? > Timeout of some kind? I figure I should be getting some kind of data off it....
Try changing to passive mode first.
Code:
$ftp_host = "yourFTPHost"; $ftp_user = "yourUsername"; $ftp_password = "yourPassword"; $conn = ftp_connect($ftp_host); ftp_login($conn, $ftp_user, $ftp_password); ftp_pasv($conn, TRUE); $file_list = ftp_nlist($conn, ""); foreach ($file_list as $file) { echo "<br>$file"; } ftp_close($conn);
|
|