Class: Uploadcare::Rails::Api::Upload::UploadApi
- Defined in:
- lib/uploadcare/rails/api/upload/upload_api.rb
Overview
A client for general uploads
Class Method Summary collapse
-
.upload_file(file, options = {}) ⇒ Object
Uploads single files smaller.
-
.upload_files(files, options = {}) ⇒ Object
Uploads several files smaller than 100MB.
Class Method Details
.upload_file(file, options = {}) ⇒ Object
Uploads single files smaller. Supports small (less that 100 MB) and large single files.
18 19 20 21 22 |
# File 'lib/uploadcare/rails/api/upload/upload_api.rb', line 18 def upload_file(file, = {}) return upload(file, ) if file?(file) || file.is_a?(String) raise TypeError, "The first argument must be a File or String (URL), #{file.class} given" end |
.upload_files(files, options = {}) ⇒ Object
Uploads several files smaller than 100MB.
uploadcare.com/api-refs/upload-api/#operation/multipartFileUploadStart
27 28 29 30 31 |
# File 'lib/uploadcare/rails/api/upload/upload_api.rb', line 27 def upload_files(files, = {}) return upload(files, ) if array_of_files?(files) raise TypeError, 'The first argument must be an Array of File objects' end |