In my project I have a file uploading feature. Files are uploaded via FTP. I need to configure a listener that will check for new files and invoke a script only when file uploading is finished. Because if I run this script immediately after detecting the new file, it can start to process file that is not completely uploaded, which will cause an error. Can anybody tell if this is possible on LINUX and how can I do this?
A possible solution would be first uploading the file with a different filename (e.g. adding ". partial") and then renaming it to its final name. If the server finds the final name then the upload has been completed.
Downloading Files with the ftp Command Once you are logged in, your current working directory is the remote user home directory. When downloading files with the ftp command, the files will be downloaded to the directory from which you typed the ftp command.
All about File Transfer Protocol and FTP clients File Transfer Protocol (FTP) is a network protocol for transferring copies of files from one computer to another. An FTP client is a program that allows you to move files between computers.
I'd try using inotify, event code IN_CLOSE_WRITE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With