Make sure the file transfer is suscess

I hv two servers ( server A and server B , server B is windows ) and have a script to run to ftp files (may be more than one file) from server A to server B in every 15 minutes , I would like to make sure the files are transferred successfully to other server , can advise what is the best way to check the files are successfully transferred or not ? if not successful , then send me a notifiy mail , can anyone provide the script or give a suggestion for it ?

ps. the windows server do NOT have ssh rsh server installed .

Thx in advance.

After you have done the ftp, run another ftp session to get the file lengths using "dir" and then compare the with what they should be.

thx reply,

but how the "another ftp session" know the ftp process is complete ( as the ftp is frenquently run ) , if I want the files ftp to server B then ftp back to server A ( another path ) , then compare these two paths , can advise how to write the script ? thx

Due to "sequential programming", most programming and scripting languages execute the statements in the order they are written, in pseudo code....

get file length of file to send

ftp file to server with put

get file length from server using ftp dir

compare with expected length