file check before FTP

Hi
I use a shell script to transfer files from UNIX to Windows 2000 server before the FTP i need to check whether any files with the same name exists. If the files are already present it need not be FTPed else the file should be FTPed.
Kindly help me.

Try using ftp "dir" to find out if the files already exist.

1) Create list of target filenames.
2) Use ftp to "dir" each filename and save the output to a workfile.
This can be done in one ftp run with a "dir" for each filename.
3) Read back the original list and eliminate files not marked "not found" in the workfile to create the final transfer list.

If all the files are going to the same directory you can just run ftp "dir" once to get a positive list of files which already exist, then use this to eliminate files from the original list.

Could u pls send me the coding for this?