I'm assuming that you want to know if you can determine if a file is in the process of being transferred by a different FTP connection. In general, this is not possible because there is no FTP command to ask if there is a file transfer in progress.
You could rely on a heuristic of polling the non-standard SIZE
command via FTP.size
to see if the size of a file is growing over time and then assume that if it stays the same size for some duration that the file is not in progress.
Note that this heuristic could potentially cause you to detect that a file is not in progress even though it still was in progress, thus you'll want to make sure that you're ok with potentially processing partially truncated files.
Keep in mind that FTP connections are sometimes disconnected and resumed at a later point in time, thus if this happens, you may have to rely on a very large timescale to detect when a file is complete unless you know for sure how big the file is expected to be.
If you have control over your clients, you could require your clients to place some other metafile next to your file uploads that tells you the expected sizes of the files you are monitoring, then you would know for certain when a file is done uploading by simply checking its file size. Similarly, you could use an MD5 or other external file validity check. Another approach could rely on the file itself being self describing and including an internal integrity check or file length. Many standard file formats include such a header.