/    Sign up×
Community /Pin to ProfileBookmark

hi guys:

I have the following code

/******************
*
TRANSFER FTP DATA*
*
**
***************/

$ftp_success=”n”;

$transfer_time = date(‘y-m-d h:i:s’);

if(($mode!=”debug” OR $batch_row[coreg_id]==549) AND !empty($batch_row[ftp_server]))
{

$ftp_fp=ftp_connect($batch_row[ftp_server]);

if(!$ftp_fp) { echo “Connection failed to $batch_row[ftp_server]”; }

$success = ftp_login($ftp_fp,$batch_row[ftp_user],$batch_row[ftp_pass]);
if(!$success) { echo “Login failed, user: $batch_row[user], pass: $batch_row[pass]”; }

if($batch_row[ftp_pasv]==”y”)
{
ftp_pasv($ftp_fp,TRUE);
}
else
{
ftp_pasv($ftp_fp,FALSE);
}

// FTP UPLOAD DIRECTORY

if($batch_row[coreg_id] == 1081)
{
$ftp_dir=$batch_row[ftp_dir] . “./$batch_row[file]”;
}
else if ($batch_row[ftp_dir])

{
$ftp_dir = $batch_row[ftp_dir] . “/$batch_row[file]”;
}
else
{
$ftp_dir = “$batch_row[file]”;
}

// WRITE FILE – QUESTION – 2MB FILE LIMIT? SEE ftp_put annotated docs on computer

if(ftp_put($ftp_fp,$ftp_dir,$path,$ftp_type))
{

$ftp_success=”y”;
}
else
{
echo “Put failed – ftp_put($ftp_fp,$ftp_dir,$path,$ftp_type)”;
mail(“[email protected]”,”cron_coreg_batch – cannot ftp – coreg_id=$batch_row[coreg_id]”,”FTP=$batc
mail(“[email protected]”,”cron_coreg_batch – cannot ftp – coreg_id=$batch_row[coreg_id]”,”FTP=$
continue;
}

ftp_quit($ftp_fp);
}

I got the following error and I could not find it out

Connection failed to [url]ftp://drpshop.com[/url]
Warning: ftp_login() expects parameter 1 to be resource, boolean given in /usr/local/cron/cron_coreg_batch.htm on line 829
Login failed, user: , pass:
Warning: ftp_pasv() expects parameter 1 to be resource, boolean given in /usr/local/cron/cron_coreg_batch.htm on line 838

Warning: ftp_put() expects parameter 1 to be resource, boolean given in /usr/local/cron/cron_coreg_batch.htm on line 858
Put failed – ftp_put(,useped02212005.txt,/home/admin/coreg/batch/batch_1513_20050221023001.txt,0)

could anyone help it? thank you

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@handong888authorFeb 22.2005 — can anyone help it? thank you very much
Copy linkTweet thisAlerts:
@NogDogFeb 22.2005 — Try telling it to connect to "drpshop.com" instead of "ftp://drpshop.com".
Copy linkTweet thisAlerts:
@handong888authorFeb 22.2005 — thank you very much
×

Success!

Help @handong888 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...