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

2015-03-23 0 652
Ruby 进行 FTP 文件传输时,每传输100k进行提醒
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

遇见资源网 ruby Ruby 进行 FTP 文件传输时,每传输100k进行提醒 http://www.ox520.com/16291.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务