python - pyftpdlib callback on sending file -


i'm developing ftp server using pyftpdlib giampaolo. i've been struggling since need process stuff when server receive retr commnand before sending given file.

my question is, there form of implementing callback or tweaking source can such validation on file before sent, , if how implement it?

you can override ftp_retr method:

from pyftpdlib.handlers import ftphandler  class handler(ftphandler):      def ftp_retr(self, file):         if not condition:             self.respond("500 sorry!")         else:             super(handler, self).ftp_retr(file) 

Comments

Popular posts from this blog

javascript - Replicate keyboard event with html button -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Web audio api 5.1 surround example not working in firefox -