Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: auto detection of file upload on ftp server

by Roger (Parson)
on Oct 15, 2004 at 12:23 UTC ( [id://399486]=note: print w/replies, xml ) Need Help??


in reply to auto detection of file upload on ftp server

It is easy to detect the arrival of a file, the hard part is to verify that the file transfer has completed or not. There are several methods to do this. Three methods on top of my head:

Method 1 - two step process. Step 1 to wait for a file, step 2 to check the size of the file and wait for it to stop growing/changing for, say, 5 minutes to ensure that the transfer is complete. This method is dangerous, because the connection could drop halfway during processing, but your process would not know and carry on with a half completed file. The result is not pleasent.

Method 2 - let the remote process send a trigger file after the file is transmitted successfully. Your process will wait for the trigger file, say, with the name of the file you are waiting for, plus the .trig extension. The problem is that remote systems may not be able to send the trigger file (3rd party application).

Method 3 - use a self verifying file format, like a zip file. The zip file carries CRC for file content validation.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://399486]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-03-28 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found