Method: Atlas::BoxProvider#upload

Defined in:
lib/atlas/box_provider.rb

#upload(file) ⇒ Object

Upload a .box file for this provider.

Parameters:

  • file (File)

    a File object for the file.



72
73
74
75
76
77
78
79
# File 'lib/atlas/box_provider.rb', line 72

def upload(file)
  # get the path for upload
  response = Atlas.client.get("#{url_builder.box_provider_url}/upload")

  # upload the file
  upload_url = response['upload_path']
  Excon.put(upload_url, body: file)
end