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

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

Ansible warning on jinja2 braces on when -

html - How to custom Bootstrap grid height? -