GET file from server, then DELETE another file from server
I'm not sure how to go about building this scenario:
- I FTP PUT a file "data.txt" to external directory
- 3rd party processes that file
- 3rd party creates a log file "errors.txt" into the same directory
- My integration build should now
- notice that there is a "errors.txt" file
- FTP GET that log file, delete it from server and process it
- but we should also delete the "data.txt" from the server as it is "used" and should no longer be there. It is essential that "data.txt" must only be deleted if there is an "errors.txt" file and we have downloaded it
Can steps 4.1 - 4.3 be done with standard components or do I need to write for example a custom FTP inbound service?
Hi Mikael,
The steps 4.1 and 4.2 Is done by the EnsLib.FTP.InboundAdapter. Check the documentation Overall Behavior.
For step 4.3 you can call the method delete from EnsLib.FTP.InboundAdapter in the method OnProcesssInput after you finalize the treatment of the "errors.txt".
Thank you for pointing me into the right direction. My Service now downloads file "errors.txt" and then in OnProcessInput method I call the following to delete "data.txt" from the same folder where "errors.txt" was downloaded from: