File is locked if ftp server is down while uploading file

We use WmPublic package service to upload file to ftp server.The
service is like this:

we successfully login ftp server and cd,then we use pub.client.ftp:put to
upload a big file(16M),It take quite a long time.During the period of
uploading file,the ftp server is down(or network is down).We found the file which is uploaded is locked.It cannot be deleted or renamed.The file is locked until the IS is restarted.It makes big trouble in our project.

Thanks very much for any advice and solution.