Method: Box::Api#upload

Defined in:
lib/box/api.rb

#upload(path, folder_id, new_copy = false) ⇒ Object

Upload the file to the specified folder.

Parameters:

  • path (String, File or UploadIO)

    Upload the file at the given path, or a File or UploadIO object..

  • folder_id (String)

    The folder id of the parent folder to use.

  • new_copy (Optional, Boolean) (defaults to: false)

    Upload a new copy instead of overwriting.



277
278
279
280
# File 'lib/box/api.rb', line 277

def upload(path, folder_id, new_copy = false)
  path = ::File.new(path) unless path.is_a?(::UploadIO) or path.is_a?(::File)
  query_upload('upload', folder_id, 'upload_ok', :file => path, :new_copy => new_copy)
end