Class: DropboxApi::Endpoints::Files::UploadSessionStart
- Inherits:
-
ContentUpload
- Object
- Base
- ContentUpload
- DropboxApi::Endpoints::Files::UploadSessionStart
- Includes:
- OptionsValidator
- Defined in:
- lib/dropbox_api/endpoints/files/upload_session_start.rb
Constant Summary collapse
- Method =
:post
- Path =
"/2/files/upload_session/start".freeze
- ResultType =
DropboxApi::Results::UploadSessionStart
- ErrorType =
nil
Instance Method Summary collapse
-
#upload_session_start(content, options = {}) ⇒ DropboxApi::Metadata::UploadSessionCursor
Upload sessions allow you to upload a single file in one or more requests, for example where the size of the file is greater than 150 MB.
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_session_start(content, options = {}) ⇒ DropboxApi::Metadata::UploadSessionCursor
Upload sessions allow you to upload a single file in one or more requests, for example where the size of the file is greater than 150 MB.
This call starts a new upload session with the given data. You can then use Client#upload_session_append_v2 to add more data and Client#upload_session_finish to save all the data to a file in Dropbox.
A single request should not upload more than 150 MB of file contents.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dropbox_api/endpoints/files/upload_session_start.rb', line 25 add_endpoint :upload_session_start do |content, = {}| ([ :close ], ) session = perform_request(, content) DropboxApi::Metadata::UploadSessionCursor.new({ "session_id" => session.session_id, "offset" => content.bytesize }) end |