This namespace contains endpoints and data types for basic file operations.
Summary
Functions
Append more data to an upload session.
Append data to multiple upload sessions in a single request. data is the
concatenated content for all sessions (iodata), split according to each
entry's "length"; entries are maps with "cursor", "length" and
optionally "close".
Appends data (iodata) to the upload session session_id at offset
(the number of bytes already uploaded to the session).
Finish an upload session and save the uploaded data to the given file path.
This route helps you commit many files at once into a user's Dropbox.
Returns the status of an asynchronous job for upload_session/finish_batch. If success, it returns list of result for each entry.
Finishes the upload session session_id, committing the uploaded bytes to
the path given in commit (a map with the /files/upload argument fields,
e.g. %{"path" => "/backup.zip", "mode" => "add"}). Optional trailing
data is appended before committing.
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.
Start multiple upload sessions at once. opts accepts "session_type"
(%{".tag" => "sequential"} or %{".tag" => "concurrent"}).
Starts an upload session with data (iodata) as its first bytes.
Returns {:ok, %{"session_id" => id}} on success.
Functions
Append more data to an upload session.
Example
Magpie.Files.UploadSession.append(client, "AAAAAAAADipnX-8-d8-V4g", false, "")
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-append_v2
Append data to multiple upload sessions in a single request. data is the
concatenated content for all sessions (iodata), split according to each
entry's "length"; entries are maps with "cursor", "length" and
optionally "close".
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-append_batch
Appends data (iodata) to the upload session session_id at offset
(the number of bytes already uploaded to the session).
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-append_v2
Finish an upload session and save the uploaded data to the given file path.
Example
Magpie.Files.UploadSession.finish(client, "AAAAAAAADipnX-8-d8-V4g", "", "")
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-finish
This route helps you commit many files at once into a user's Dropbox.
Example
entry = %{ "cursor" => %{ "session_id" => "AAAAAAAADipnX-8-d8-V4g", "offset" => 0}, "commit" => %{ "path" => "/Homework/math/Matrices.txt" }} entries = [entry] Magpie.Files.UploadSession.finish_batch client, entries
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-finish_batch_v2
Returns the status of an asynchronous job for upload_session/finish_batch. If success, it returns list of result for each entry.
Example
Magpie.Files.UploadSession.finish_batch_check(client, "")
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-finish_batch-check
Finishes the upload session session_id, committing the uploaded bytes to
the path given in commit (a map with the /files/upload argument fields,
e.g. %{"path" => "/backup.zip", "mode" => "add"}). Optional trailing
data is appended before committing.
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-finish
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.
Example
Magpie.Files.UploadSession.start(client, false, "/Tmp")
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-start
Start multiple upload sessions at once. opts accepts "session_type"
(%{".tag" => "sequential"} or %{".tag" => "concurrent"}).
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-start_batch
Starts an upload session with data (iodata) as its first bytes.
Returns {:ok, %{"session_id" => id}} on success.
Use this (together with append_data/5 and finish_data/5) when you
control the chunks yourself; for the common "upload this local file"
case prefer Magpie.Files.upload_file/4, which orchestrates the whole
session automatically.
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-start