ftpfilezilla

Pause FTP-Login, triggered file creation


Currently I'm generating 600+ files into a FTP-directory-structure by which customers can get one of these files. After some tweaking it takes about 20 minutes to generate those files, but the amount of files rises daily (more customers get FTP-logins to "their" file).

I was thinking if one could somehow get into FileZilla (the FTP-server used) or create a FTP-server on one's own that does something like the following:

When a customer log in via FTP, the login is not done directly. After authentication the FTP-protocol "pauses" and the file generation for that one file needed is triggered. Once the file is generated into the customer's FTP-directory (takes about 2 to 5 seconds), FTP resumes the login and the customer is able to enter his directory filled with a brand-new file.

By that I generate only those files actually needed, when they're needed.

Any ideas, where to start with that?

A big plus would be if I could use the FileZilla-configuration-file so I won't have to reset any passwords.


Solution

  • The FileZilla FTP server is open source, so you can grab its code and modify it as you need.

    See the method CControlSocket::DoUserLogin. Modify it to do any action you need before returning TRUE (which triggers "230 Logged on" response).


    Most commercial FTP servers support event scripts/hooks. You can use these to implement the file creation on login.

    From free FTP servers, ProFTPD supports events, via its mod_exec module. But ProFTPD is for *nix, not Windows.