Hi,
You can do this without code also. Add the following rules to the attachment control.
1. Set the condition as attachment is not blank.
2. Add 2 actions as
a. Set the first text box value to today().
b. Set the second text box value to concat(<first text box field>, ";", <second text box field>)