嗨,我有这个AJAX电话:
listCall = $.ajax({
type: 'POST',
url: "ftpFunction.php",
data: {"request":"list","path":path},
dataType: "text",
cache: 'false',
beforeSend: function(){
$(".fileContainer").append("<p id='waiting' style='margin-left:45%; margin-top:20%;'>" + waitingText + "</p>");
},
success: function (response) {
$("p#waiting").remove();
$(".fileContainer").append("<form action='/file-upload' class='dropzone' id='my-awesome-dropzone'></form>");
$(".fileContainer").append(response);
}
});
和这个PHP代码:
$path = $_POST["path"];
$contents = ftp_nlist($conn_id, $path);
.
.
.
echo $resultString
当我尝试列出目录文件时,单个单词作为文件夹名称(例如&#34; testFolder&#34;)我可以列出他的文件,但如果我尝试打开一个包含两个或更多单词的文件夹(例如&#34;测试文件夹&#34;)php不返回任何结果字符串。 为什么呢?
这是cmd ftp的日志文件,证明我可以访问目录:
ftp> cd "Ftp test"
250 OK. Current directory is /test/Ftp test
ftp> ls
200 PORT command successful
150 Connecting to port 50714
Cattura27.PNG
Query.txt
indirizzi per davide.csv
226 3 matches total ftp: 55 bytes received in 0.01secondi 11.00Kbyte/sec)
ftp> –