|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-09-13 08:36 UTC] yura at freeweb dot ru
Ftp works very bad, sometimes ftp-get return error,but what error i don'y know.
So that is my script:
<?
$ftp_server="someserver";
$ftp_user_name="somelogin";
$ftp_user_pass="somepass";
$ftp_conn=ftp_connect($ftp_server);
$to_dir="htdocs/desktop/inc2/desktop/";
echo( date('d-m-Y H:i:s').'<BR>' );
$login_result = ftp_login($ftp_conn, $ftp_user_name, $ftp_user_pass);
if ((!$ftp_conn) || (!$login_result)) {
echo "FTP connection broken!<br>";
echo "??????? ?????????????? ? ??????? $ftp_server ??? ?????? $ftp_user_name<br>";
die;
} else {
echo "CONNECT OK $ftp_server, ??? ?????? $ftp_user_name ???????";
}
echo( date('d-m-Y H:i:s').'<BR>' );
flush();
ftp_chdir($ftp_conn,$to_dir);
echo("ftp_chdir<br>");
echo( date('d-m-Y H:i:s').'<BR>' );
flush();
echo( date('d-m-Y H:i:s').'<BR>' );
flush();
$files=ftp_nlist ($ftp_conn,"");
echo("ftp_nlist<br>");
echo( date('d-m-Y H:i:s').'<BR>' );
flush();
ftp_pasv($ftp_conn,1);
#for($i=0;$i<sizeof($files);++$i){
for($i=0;$i<sizeof($files);++$i){
if(substr($files[$i],0,3)=="cat" or $files[$i]=="new.inc")
{
echo $files[$i]."---".date("H:i:s")."<br>";
if(file_exists("inc2/".$files[$i])){unlink("inc2/".$files[$i]);}
echo( date('d-m-Y H:i:s').'<BR>' );
flush();
if ( ftp_get($ftp_conn,"inc2/".$files[$i],$files[$i],FTP_BINARY) ) {
echo "DOWNLOADED FILE $files[$i]<br>";
flush();
} else {
echo "ERROR WHILE DOWNLOADING FILE $files[$i]<br>";
flush();
}
echo( date('d-m-Y H:i:s').'<BR>' );
flush();
}
}
?>
Result:
ftp_chdir
13-09-2002 13:37:26
13-09-2002 13:37:26
ftp_nlist
13-09-2002 13:37:26
13-09-2002 13:37:26
Warning: ftp_get: in /usr/local/apache/htdocs/wwwcgiru/get.php on line 37
ERROR WHILE DOWNLOADING FILE cat114.inc
13-09-2002 13:38:56
13-09-2002 13:38:56 <-- LOOK HERE
Warning: ftp_get: in /usr/local/apache/htdocs/wwwcgiru/get.php on line 37
ERROR WHILE DOWNLOADING FILE cat2.inc
13-09-2002 13:40:26 <-- THEN LOOK HERE
13-09-2002 13:40:26
Look for time,it differ on 1.5 minutes
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 21:00:02 2025 UTC |
problum is this when i use this echo date("d-m-Y"); syntax is show current date of my system in php page. but when i upload this form then i show one day back please help me to solve the problum. my e-mail is : ss_kharay@yahoo.co.in Thanks.