From 60b527d5a4369bc73943f27b40febb407eb8404c Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 5 Sep 2015 16:25:57 +0100 Subject: [PATCH] Function added to delete file/dir over FTP --- lib/ftp-control.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ftp-control.php b/lib/ftp-control.php index e46f96d..93b388f 100644 --- a/lib/ftp-control.php +++ b/lib/ftp-control.php @@ -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); + } +} ?> \ No newline at end of file