I am getting the following error when I run this script can anyone please help me figure this out. I am in a serious situation here.
error:
WARNING: ftp_put():3 is not a valid FTP Buffer resource in
Thanks
$ftp_server = "*********";
$ftp_user = "*********";
$ftp_pass = "**********";
$conn_id = ftp_connect($ftp_server);
$login = ftp_login($conn_id, $ftp_user, $ftp_pass);
########End Variables#######
###### Check for Connection #######
$this->conn = $conn_id;
if((!$conn_id) || (!$login))
{
die("FTP connection has failed!!");
}
$handle = opendir('/var/aetna/post-reply/');
ftp_chdir($this->conn , "/TRACKING_RECORDS/SENT_BY_DMP_EPUBPOSTRETURNS/");
while($filename = readdir($handle))
{
if (preg_match ("/EPUBPOSTREPLY_/i", $filename))
{
$fp = fopen("/var/aetna/post-reply/".$filename, 'r');
rewind($fp);
$destFile = $filename;
$src_dir = "/var/aetna/post-reply/";
echo "fp =: ".$fp."<br>";
echo "destFile =: ".$destFile."<br>";
echo "filename =: ".$filename."<br>";
$upload = ftp_put($conn_id, $destFile, $src_dir."/".$file, FTP_BINARY);
if (FALSE == $upload)
{
echo "failed";
}else{
unlink("/var/aetna/post-reply/" . $filename);
ftp_close($this->conn);
}
}
} // while;