Question
Mikael Toivonen · Sep 29, 2020

GET file from server, then DELETE another file from server

I'm not sure how to go about building this scenario:

  1. I FTP PUT a file "data.txt" to external directory
  2. 3rd party processes that file
  3. 3rd party creates a log file "errors.txt" into the same directory
  4. My integration build should now 
    1. notice that there is a "errors.txt" file
    2. FTP GET that log file, delete it from server and process it 
    3. 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?

00
0 2 82 2

Replies

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:

If ..Adapter.delete("data.txt", pInput.Attributes("FTPDir") ){  <log that deletion was successful> }