Ruby 进行 FTP 文件传输时,每传输100k进行提醒

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

require 'net/ftp'

ftp = Net::FTP.new('ftp.domain.com')
ftp.passive = true
ftp.login
ftp.chdir('/your/folder/name/here')

count = 0

ftp.putbinaryfile('local_file', 'local_file', 100000) do |block|
  count += 100000
  puts "#{count} bytes uploaded"
end

ftp.close