    # File lib/facets/more/uploadutils.rb, line 100
      def sftp( keys )
        keys = upload_parameters(keys)

        # set transfer rules
        if keys.stage
          trans = stage_transfer(keys.stage)
        else
          files(keys.dir, keys.copy).each do |from|
            trans << [from,from]
          end
        end

        # append location of publication dir to from
        dir = keys.dir
        trans.collect!{ |from,to| [File.join(dir,from), to] }

        if keys.dryrun
          puts "sftp open #{keys.user}@#{keys.host}:#{keys.root}/"
          keys.trans.each do |f,t|
            puts "sftp put #{f} #{t}"
          end
        else
          require 'net/sftp'
          Net::SFTP.start(keys.host, keys.user, keys.pass) do |sftp|
            #sftp.login( user )
            sftp.chdir(keys.root)
            keys.trans.each do |f,t|
              puts "sftp #{f} #{t}" unless keys.quiet
              sftp.put_file(f,t) #, 1024 )
            end
          end
        end
      end