Function added to delete file/dir over FTP

This commit is contained in:
Matt Pass
2015-09-05 16:25:57 +01:00
parent 1c99f127be
commit 60b527d5a4

View File

@@ -101,4 +101,15 @@ function ftpPerms($ftpConn, $perms, $filePath) {
// Return success status of perms change
return ftp_chmod($ftpConn, $perms, $filePath);
}
// Delete dir/file over FTP
function ftpDelete($ftpConn, $type, $path) {
if ($type == "file") {
// Delete our file and return true/false
return ftp_delete($ftpConn, $path);
} else {
// Delete our dir and return true/false
return ftp_rmdir($ftpConn, $path);
}
}
?>