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

html - How to custom Bootstrap grid height? -

javascript - pass values from mssql to views in node -

ruby - unknown property method: 'wait' on EC2 windows server Instance -