FTP Delete File Action - This action is used to delete only one file at a time on the FTP server. I want to delete all the files and sub folders inside a Application folder. Application folder may have subdirectories also. Do we have any way to use wild cards (like *.*) in 'FTP Delete File Action' to delete all files and subdirectories?
It would be great and I really appreciate your help regarding the same.
This is basically because FTP doesn’t support recursive delete, or multiple file deletes. The actions we provide match directly to the commands available so that any scripts can be made with these building blocks.
To solve your current issue, you will need to use the List Directory command with the file spec for the list of files you wish to delete. Push the value from this into a variable. Then iterate through this list and delete each files from the FTP server. Then delete the directory in question, note that is usually has to be empty before FTP servers allow deletion of a directory. This can then be repeated for each directory you wish to delete files for.
Thanks for reply. Do you think this is complex to implement but not impossible, specially deleting the contens from each and every subdirectories to ensure the directory should be empty and ready for delete? Do you have any way to delete the directories, sub directories including other contents in a single shot using some wild card characters? I want to clean the virtual directory before any new deployment.
I certainly don’t think this is complex to implement or impossible with the features currently present in FinalBuilder. There are actions which allow you to list all the files you wish to delete, then iterators and delete calls which can delete those files. In my previous post I detailed how this can be achieved with the current actions available.
At this stage we have no plans to add an action for deleting multiple files from FTP in FinalBuilder 7.
“…use the List Directory command with the file spec for the list of files you wish to delete”. This is the “FTP List Directory” action.
Taken from:
"To solve your current issue, you will need to use the List Directory command with the file spec for the list of files you wish to delete. Push the value from this into a variable. Then iterate through this list and delete each files from the FTP server. Then delete the directory in question, note that is usually has to be empty before FTP servers allow deletion of a directory. This can then be repeated for each directory you wish to delete files for. "