I wanted to delete the files from a remote folder and I used the tFTPDelete component. Here is the configuration for it:
Basically, I wanted to empty this folder but KEEP the folder still. Initially, I put "*" on filemask and the job failed, and below is the error code:
Exception in component tFTPDelete_3 (movefiles)
24: This request cannot be used to remove a directory
Then I put a new filemask ( shown above), all the files match that pattern except one .zip file. I ran the job again and the files were deleted, only .zip was left in the folder.
BTW, both times the Target Type was "File".
I am thinking - does tFTPDelete not allow us to empty a folder if we choose "File" as Target Type?
Thanks for your quick response, here is what I observed:
Even though "Die on error" was unticked, the job still wouldn't run, it would just stop:
This request cannot be used to remove a directory
2. Only one component is needed to delete the files and directory:
My question still is : how to delete the files and still keep the folder on remote server? Is that possible?
I think I get the answer to my own question.
If I want to delete all the files from a folder but still keep the directory, I will need to use specific file mask(s) which would delete all the files, but the file mask shouldn't be "*".
For example, if I have below files in a folder, I should use file mask "Testfile_*" and "file_*" to delete all the files.
As long as specific file mask(s) is used to delete all the files, it doesn't matter Target Type is "File" or "Directory", it would only delete the files and always keep the directory.
Only the file mask "*" + Target Type "Directory" combination would delete the directory.
@TigerMommy,yes you can use the data mask from the tFTPList.
tFTPList--Iterate-->tFTPDelete and use the global parameter from FTPList in FTPDelete.