n the following program i have the error
Warning: ftp_delete() [function.ftp-delete]: Access is denied. in G:\WEBROOT\wilbourn\ftptest\uploadfunctionpage.php on line 89
could not delete wilbourn/ftptest/t.DOC
<?php
//Move or Upload Folder Using PHP FTP Functions
function moveFolder($_server, $_user_name, $_user_pass, $local_dir, $remote_dir) {
echo"$_user_name <br/>";
echo"$_user_pass <br/>";
echo" directories are : <br/>";
echo"$local_dir<br/>";
echo"$remote_dir <br/>";
// set up basic connection
$_conn_id = ftp_connect($_server);
// login with username and password
$_login_result = ftp_login($_conn_id, $_user_name, $_user_pass);
// check connection
if ((!$_conn_id) || (!$_login_result)) {
$_error = "FTP connection has failed!";
$_error .= "Attempted to connect to $_server for user $_user_name";
$result = false;
} else {
$_error = "Connected to $_server, for user $_user_name";
}
$conn_id = $_conn_id;
$file = "t.DOC";
echo "Current directory: " . ftp_pwd($conn_id) . "\n";
echo "<br/>";
echo "<br/>";
if (ftp_chdir($conn_id, "$remote_dir")) {
echo "Current directory is now After changes: " . ftp_pwd($conn_id) . "\n";
echo "<br/>";
echo "<br/>";
echo "<br/>";
// try to delete $file
if (ftp_delete($conn_id, $file)) {
echo "$file deleted successful\n";
} else {
echo "could not delete $file\n";
}
}
else {
echo "Couldn't change directory\n";
}