This is a script that I have inherited. As far as I know, this script was working a few weeks ago. I am able to manually download the file from the local path and upload to the remote path.
Network admin has been making some changes to our servers, but I’m not sure if they’ve done anything that would have effected this script.
What could be causing the error? What do I need to do?
Any and all help is greatly appreciated. Error and code is below.
Thanks.
PHP Warning: ftp_get(): Error opening pdfs/10002_eval.pdf in c:\blah\blah\blah\blah\testboard_dbquery.php on line 323
// Connect to ftp server
$connection = ftp_connect("XXX.XXX.XXX.XXX");
$login_result = ftp_login($connection, "****", "****");
// Get or delete files as necessary
while($row = mssql_fetch_array($results))
{
// Add app_id to array
array_push($applicants, $row['app_id']);
// Get appropriate extension for file
if(under_appeal($row['app_id']) || under_reevaluation($row['app_id'])) continue;
else
{
if($appeal = mssql_fetch_assoc(mssql_query("SELECT CONVERT(char(6), appeal_complete_date, 112) AS appeal_complete_date FROM appeal WHERE app_id = " . $row['app_id']))) $ext = "_review.pdf";
else if($reeval = mssql_fetch_assoc(mssql_query("SELECT CONVERT(char(6), reevaluation_complete_date, 112) AS reevaluation_complete_date FROM reevaluation WHERE app_id = " . $row['app_id']))) $ext = "_reeval.pdf";
else $ext = "_eval.pdf";
// If days_released is less than 60, get the file; else delete the file if it exists
if($row['days_released'] <= 60)
{
if(!file_exists("pdfs/" . $row['app_id'] . $ext))
{
ftp_get($connection, "pdfs/" . $row['app_id'] . $ext, "final_evaluations/" . $row['app_id'] . $ext, FTP_ASCII);
}
else echo "<!--".$row['app_id']." Already out there-->\n";
}
else if(file_exists("pdfs/" . $row['app_id'] . $ext)) unlink("pdfs/" . $row['app_id'] . $ext);
}
}
// Close the ftp connection
ftp_close($connection);