示例#1
0
 def _store_in_thread(self, file, spider):
     ftp = FTP()
     ftp.connect(self.host, self.port)
     ftp.login(self.username, self.password)
     dirname, filename = posixpath.split(self.path)
     ftp_makedirs_cwd(ftp, dirname)
     ftp.storbinary('STOR %s' % filename, file)
     ftp.quit()
示例#2
0
 def _store_in_thread(self, file, spider):
     ftp = FTP()
     ftp.connect(self.host, self.port)
     ftp.login(self.username, self.password)
     dirname, filename = posixpath.split(self.path)
     ftp_makedirs_cwd(ftp, dirname)
     ftp.storbinary('STOR %s' % filename, file)
     ftp.quit()
示例#3
0
 def _store_in_thread(self, file):
     file.seek(0)
     ftp = FTP()
     ftp.connect(self.host, self.port)
     ftp.login(self.username, self.password)
     dirname, filename = posixpath.split(self.path)
     ftp_makedirs_cwd(ftp, dirname)
     ftp.storbinary('STOR {0!s}'.format(filename), file)
     ftp.quit()
示例#4
0
 def _store_in_thread(self, file):
     file.seek(0)
     ftp = FTP()
     ftp.connect(self.host, self.port)
     ftp.login(self.username, self.password)
     if self.use_active_mode:
         ftp.set_pasv(False)
     dirname, filename = posixpath.split(self.path)
     ftp_makedirs_cwd(ftp, dirname)
     ftp.storbinary('STOR %s' % filename, file)
     ftp.quit()