Compare Files By Content Using FileContentCompare

Posted by Hari Prasad on Sep 11, 2018 9:00:00 AM

This custom trigger function is used to compare the files on content

See How to Create Custom Trigger Functions for details on installation.

Downloads

Source code and build instructions

How to Compare Files using FileContentCompare Function

 Let me now show you how to implement that.

 

1. Make sure you have FileContentCompare function installed

Before creating a custom trigger to use the function FileContentCompare, you need to

have build installed in the server where JSCAPE MFT Server is running.

 

2. Create a Trigger to compare content on File Upload

Now login into admin console of JSCAPE MFT Server > Triggers and Click Add to create a Trigger

Give the trigger a Name and then select the File Upload event type from the drop-down list. 

 

file_content_compare_img1

 

Click Next to Step 2 to set the condition to check the uploaded file content to already existing file.

Use the below condition;

Click Functions button to select the FileContentCompare(file1,file2) function.

 

file_content_compare_img2

If the function not listed you need to have build installed in the server.

 

FileContentCompare(LocalPath,"<file-path-to-check>")=true

 

Below screen shows that an uploaded file content is compared with already existing file

file_content_compare_img3

Click Next to proceed. On TRUE move the files.

On Step 3 an action has to be added, in order to add an action click Add button and select the action "Move File" from drop down list and Click OK

 

move_file

 

On OK there would be two parameters for Move File Action;

  - File (Uploaded File) - Use %LocalPath% to get the uploaded file

  - Destination Directory (Directory to be moved)

 

file_content_compare_img4

Click Ok to save the settings. That's it. Now you know how to use the custom function FileContentCompare and move file on compare content with another file in the server.

Downloads

Download JSCAPE MFT Server

Topics: JSCAPE MFT Server, Functions