I need a working code for deleting an uploded file on the ftp server.I do have a script but it dosn't work..
<?php
// set up the settings
$file = 'old.txt';
$ftp_server = someone.net';
$ftpuser = 'user';
$ftppass = 'passwd';
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftpuser, $ftppass);
// try to delete $file
if (ftp_delete($conn_id, $file)) { // the ftp function
echo "$file deleted successful\n";
} else {
echo "could not delete $file\n";
}
// close the connection
ftp_close($conn_id);
?>
this code is not able to find the old.txt,but this file is placed in the same directory where the script is located.:-/