troubleshooting Question

file_exists

Avatar of cdrami
cdrami asked on
HTMLPHP
7 Comments1 Solution336 ViewsLast Modified:
i am doing a file search and ftp drop in this script below, i want to be able to look for a file with a string in it.  Not just a static file.  They will have dates in each filename so what imdoing wont work.
<?php
$filename = "D:/DATA/iwireless_kroger_rebate.txt";
if(file_exists($filename))
{
$file = 'D:\DATA\iwireless_kroger_rebate.txt';
$remote_file = 'Integration\Rebates\iwireless_kroger_rebate.txt';
$ftp_server = "ts.genieglobal.com";
// set up basic connection
$conn_id = ftp_connect($ftp_server);

$ftp_user_name = "qualution";
$ftp_user_pass = "16Bl0ck$";
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
 echo "successfully uploaded $file\n";
} else {
 echo "There was a problem while uploading $file\n";
}

// close the connection
ftp_close($conn_id);
}




else
{
	echo "the file does not exist"; 
}
?>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros