def upload(key, data_or_path, headers = {})
      if data_or_path.respond_to?(:read) && data_or_path.respond_to?(:size)
        upload_io(key, data_or_path, data_or_path.size, headers)
      elsif !File.file?(data_or_path.to_s)
        raise ArgumentError, "data_or_path must be an IO with data or filename string"
      else
        File.open(data_or_path.to_s, "rb") do |io|
          upload_io(key, io, io.stat.size, headers)
        end
      end
    end
def upload(key, data_or_path, headers = {})
      if data_or_path.respond_to?(:read) && data_or_path.respond_to?(:size)
        upload_io(key, data_or_path, data_or_path.size, headers)
      elsif !File.file?(data_or_path.to_s)
        raise ArgumentError, "data_or_path must be an IO with data or filename string"
      else
        File.open(data_or_path.to_s, "rb") do |io|
          upload_io(key, io, io.stat.size, headers)
        end
      end
    end
Upload data_or_path (which may be a filename or an IO) to the container, as key.

 If headers are provided they will be added to to upload request. Use this to
 manually specify content type, content disposition, CORS headers, etc.