FTP – Compare Files and Email Report

This sample task will compare the files that are located within a folder in an FTP site with files residing in a local folder. A Nested Loop occurs (Loop within a Loop) to evaluate whether the current file name specified in the FTP server matches that of any file names residing in the local directory. If the file names match, the task will then evaluate whether the file sizes are the same. If the file names and file sizes are identical, no download will occur for that particular file.

However, if the current file name residing in the FTP server does not match that of any file names residing in the local directory or if the file names match but the file sizes do not, the task will then write that particular file name to a text file. The text file will include the current date to differentiate it from the day before. Then it will download that particular file to the local directory. Lastly, it will email the newly created report to the proper individual.

This task is ideal for daily automated FTP transmissions, especially when dealing with large files. Not only will it create and email a daily report of the files being downloaded but it will alleviate the issue of having to download all files to a local directory even though the files already exist locally.

NOTE: In order for the task to work properly, please make changes to the 'FTP Logon' action to match your FTP Logon parameters. Also, make sure to adjust the steps specifying file locations to match your FTP server and local system directories.

Click here to download this task