pub fn upload_session_start(
client: &impl UserAuthClient,
arg: &UploadSessionStartArg,
body: &[u8],
) -> Result<UploadSessionStartResult, Error<UploadSessionStartError>>
sync_routes
and dbx_files
only.Expand description
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 upload_session_append_v2()
to
add more data and upload_session_finish()
to save all
the data to a file in Dropbox. A single request should not upload more than 150 MB. The maximum
size of a file one can upload to an upload session is 350 GB. An upload session can be used for
a maximum of 7 days. Attempting to use an
UploadSessionStartResult::session_id
with
upload_session_append_v2()
or
upload_session_finish()
more than 7 days after its
creation will return a UploadSessionLookupError::NotFound
. Calls to this endpoint will count
as data transport calls for any Dropbox Business teams with a limit on the number of data
transport calls allowed per month. For more information, see the Data transport limit
page. By default, upload
sessions require you to send content of the file in sequential order via consecutive
upload_session_start()
,
upload_session_append_v2()
,
upload_session_finish()
calls. For better performance,
you can instead optionally use a UploadSessionType::Concurrent
upload session. To start a
new concurrent session, set UploadSessionStartArg::session_type
to
UploadSessionType::Concurrent
. After that, you can send file data in concurrent
upload_session_append_v2()
requests. Finally finish
the session with upload_session_finish()
. There are
couple of constraints with concurrent sessions to make them work. You can not send data with
upload_session_start()
or
upload_session_finish()
call, only with
upload_session_append_v2()
call. Also data uploaded
in upload_session_append_v2()
call must be multiple
of 4194304 bytes (except for last
upload_session_append_v2()
with
UploadSessionStartArg::close
to true
, that may contain any
remaining data).