Class: DropboxApi::Endpoints::Files::Upload
- Inherits:
-
ContentUpload
- Object
- Base
- ContentUpload
- DropboxApi::Endpoints::Files::Upload
- Includes:
- OptionsValidator
- Defined in:
- lib/dropbox_api/endpoints/files/upload.rb
Constant Summary collapse
- Method =
:post
- Path =
"/2/files/upload".freeze
- ResultType =
DropboxApi::Metadata::File
- ErrorType =
DropboxApi::Errors::UploadError
Instance Method Summary collapse
-
#upload(path, content, options = {}) ⇒ Object
Creates a new file.
Methods included from OptionsValidator
Methods inherited from ContentUpload
#build_request, #initialize, #perform_request
Methods inherited from Base
Constructor Details
This class inherits a constructor from DropboxApi::Endpoints::ContentUpload
Instance Method Details
#upload(path, content, options = {}) ⇒ Object
Creates a new file.
Do not use this to upload a file larger than 150 MB.
For larger files you can use #upload_by_chunks.
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/dropbox_api/endpoints/files/upload.rb', line 49 add_endpoint :upload do |path, content, = {}| ([ :mode, :autorename, :client_modified, :mute ], ) [:path] = path commit_info = DropboxApi::Metadata::CommitInfo. perform_request(commit_info.to_hash, content) end |