Sha256: 57fbf13e38f9caea77efd95eef732cb8cbe827eb6d6fa6ccecfa6ca78945cb83

Contents?: true

Size: 555 Bytes

Versions: 8

Compression:

Stored size: 555 Bytes

Contents

require_relative 'we_transfer_client'
require 'dotenv'
Dotenv.load

client = WeTransfer::Client.new(api_key: ENV.fetch('WT_API_KEY'))
transfer = client.create_transfer(name: 'My amazing transfer', description: 'Hi there!') do |builder|
  builder.add_file(name: File.basename(__FILE__), io: File.open(__FILE__, 'rb'))
  builder.add_file(name: 'amazing.txt', io: StringIO.new('This is unbelievable'))
  builder.add_file(name: 'huge.bin', io: File.open('/path/to/local/file.jpg', 'rb'))
  builder.add_file_at(path: __FILE__)
end

puts transfer.shortened_url

Version data entries

8 entries across 4 versions & 1 rubygems

Version Path
wetransfer-0.9.0.beta3 examples/create_collection.rb
wetransfer-0.9.0.beta3 examples/create_transfer.rb
wetransfer-0.9.0.beta2 examples/create_collection.rb
wetransfer-0.9.0.beta2 examples/create_transfer.rb
wetransfer-0.9.0.beta1 examples/create_collection.rb
wetransfer-0.9.0.beta1 examples/create_transfer.rb
wetransfer-0.9.0.beta examples/create_collection.rb
wetransfer-0.9.0.beta examples/create_transfer.rb