Mega Code Archive

 
Categories / Ruby / Network
 

Keep the user informed of the progress of the upload

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