English 中文(简体)
FTP_NLIST PHP Is bool(false)
原标题:FTP_NLIST PHP Is bool(false)
  • 时间:2010-06-18 17:03:12
  •  标签:
  • php
  • ftp

很遗憾,当我管理这一文字时,我与3个不同的主人联系。

它复制名录上的档案,并将其下载到网站上。

I m 稍有问题,其中两部属于......。

我转向被动,但似乎仍然回到ool(al)头。

Updating server 1
bool(false) 
Warning: ftp_get() [function.ftp-get]: Filename cannot be empty in updater.php on line     42

Warning: ftp_get() [function.ftp-get]: Error opening in updater.php on line 42
Updated cache...
bool(false) 
Warning: ftp_get() [function.ftp-get]: Filename cannot be empty in updater.php on line     60

Warning: ftp_get() [function.ftp-get]: Error opening in updater.php on line 60
BZh9rE8PUpdated maps...
Updating server 2
bool(false) 
Warning: ftp_get() [function.ftp-get]: Filename cannot be empty in updater.php on line     103

Warning: ftp_get() [function.ftp-get]: Error opening in updater.php on line 103
Updated cache...
bool(false) 
Warning: ftp_get() [function.ftp-get]: Filename cannot be empty in updater.php on line     121

Warning: ftp_get() [function.ftp-get]: Error opening in updater.php on line 121
BZh9rE8PUpdated maps...
Updating server 3
array(1) { [0]=> string(36) "1ba90fa2e972b50cdaa6bb23c403296b.dua" } Updated cache...
array(8) { [0]=> string(6) "graphs" [1]=> string(22) "sb_Forlorn_sb3_R2L.bsp" [2]=>     string(17) "sb_gooniverse.bsp" [3]=> string(22) "sb_lostinspace_rc5.bsp" [4]=> string(19)     "sb_new_worlds_2.bsp" [5]=> string(22) "sb_Spacewar_SB3_V1.bsp" [6]=> string(21)     "sb_twinsuns_fixed.bsp" [7]=> string(10) "soundcache" } Updated maps...

。 部分文字:

ftp_pasv($conn, true); 
ftp_chdir($conn,"$DIR/maps/"); 

$files = ftp_nlist($conn,"*.*"); 
var_dump($files);

chdir( sandbox/cache/ );

for($i=0;$i<count($files);$i++){ 
    if(!ftp_is_dir($files[$i])){
        usleep(500000); 
        if(!file_exists($files[$i])){
            ftp_get($conn,$files[$i],$files[$i],FTP_ASCII); 
        }
    }
} 

echo "Updated cache...<br />";
最佳回答

您没有正确使用<代码>ftp_nlist()。

manual for ftp_nlist(具体说明第二个论点是名录(由方略)。 它看一看你是否试图表示档案名称的格局。

你的法典正在使用:

$files = ftp_nlist($conn,"*.*"); 

除非有一份名称为<代码>的目录,*,否则将不可行。

页: 1

例如:

$files = ftp_nlist($conn, ".");

现有名录中可能列入<代码>(DIR/maps/)关于你的范例代码的档案。

您或许还需要转向优惠制被动模式,以应付贵方书封面的东道方与受援方之间的防火墙问题。 Refer to the manual for ftp_pasv( for details.

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签