Is there a way to delete all files and folders on ftp by one click with using php? I searched by google and stackoverflow but there are no results for the all files, just for single file or folder. So can anyone help me about this?
Asked
Active
Viewed 2,354 times
0
-
I think you would need to use mdelete to delete all files, then iterate over the directories and call rmdir on them – beresfordt Feb 20 '15 at 21:50
1 Answers
1
There's no way in FTP to delete a directory recursively using a single command. If that's what you mean by "one click".
You have to recursively list folder and delete files and subfolders one-by-one.
For that see:
Delete folder and all files on FTP connection

Community
- 1
- 1

Martin Prikryl
- 188,800
- 56
- 490
- 992