Method: Net::FTP#puttextfile
- Defined in:
- lib/extensions/net-http/net/ftp.rb
#puttextfile(localfile, remotefile = File.basename(localfile), &block) ⇒ Object
Transfers localfile to the server in ASCII (text) mode, storing the result in remotefile. If callback or an associated block is supplied, calls it, passing in the transmitted data one line at a time.
624 625 626 627 628 629 630 631 |
# File 'lib/extensions/net-http/net/ftp.rb', line 624 def puttextfile(localfile, remotefile = File.basename(localfile), &block) # :yield: line f = open(localfile) begin storlines("STOR " + remotefile, f, &block) ensure f.close end end |