PHP的FTP目录列表错误 [英] PHP FTP directory listing error
本文介绍了PHP的FTP目录列表错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
array(1){
[0] =>
string(8)outgoing
}
bool(false)
array(1){
[0] =>
string(8)outgoing
}
bool(false)
目前正在制作
$ connect = ftp_connect('example.com');
$ result = ftp_login($ connect,'username','password');
echo'< pre>';
var_dump(ftp_nlist($ connect,''));
var_dump(ftp_nlist($ connect,'/ outgoing /'));
var_dump(ftp_nlist($ connect,'/ 2689312 /'));
var_dump(ftp_nlist($ connect,'/ 2689312 / outgoing /'));
但为什么不让列表比顶层目录低?这真是让我难受。我甚至无法进入子文件夹,更不用说我需要打开的完整文件夹方案。
有什么想法?
解决方案
获取CWD的列表,而不是:
你需要做的是: 我相信如果你想更深入该目录必须是: var_dump(ftp_nlist(
var_dump(ftp_nlist($ connect,'。'));
./子目录
array(1) {
[0]=>
string(8) "outgoing"
}
bool(false)
array(1) {
[0]=>
string(8) "outgoing"
}
bool(false)
Is currently being produced by
$connect = ftp_connect('example.com');
$result = ftp_login($connect, 'username', 'password');
echo '<pre>';
var_dump(ftp_nlist($connect, ''));
var_dump(ftp_nlist($connect, '/outgoing/'));
var_dump(ftp_nlist($connect, '/2689312/'));
var_dump(ftp_nlist($connect, '/2689312/outgoing/'));
But why isn't it letting me list lower than the top directory? This is really stumping me. I can't even get into a sub folder let alone the full folder scheme I need to open.
Any ideas?
解决方案
To get the list of the CWD, instead of:
var_dump(ftp_nlist($connect, ''));
you need to do:
var_dump(ftp_nlist($connect, '.'));
I believe if you want to deeper from there the directory must be:
./subdirectory
这篇关于PHP的FTP目录列表错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文