ElixirDropbox v0.0.8 ElixirDropbox.Files
This module contains endpoints and data types for basic file operations.
Link to this section Summary
Functions
Copy a file or folder to a different location in the user’s Dropbox. If the source path is a folder all its contents will be copied
Create folder returns map
Create folder returns Folder struct
Delete the file or folder at a given path. If the path is a folder, all its contents will be deleted too. A successful response indicates that the file or folder was deleted. The returned metadata will be the corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata object
Delete folder returns Folder struct
Download a file from a user’s Dropbox
Returns the metadata for a file or folder
Get a preview for a file
Get a temporary link to stream content of a file. This link will expire in four hours and afterwards you will get 410 Gone. Content-Type of the link is determined automatically by the file’s mime type
Get a thumbnail for an image
Get thumbnails for a list of images. We allow up to 25 thumbnails in a single batch
Move a file or folder to a different location in the user’s Dropbox. If the source path is a folder all its contents will be moved
Restore a file to a specific revision
Searches for files and folders
Create a new file with the contents provided in the request
Link to this section Functions
Copy a file or folder to a different location in the user’s Dropbox. If the source path is a folder all its contents will be copied.
Example
ElixirDropbox.Files.copy(client, “/Temp/first”, “/Tmp/second”)
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-copy_v2
Create folder returns map
Example
ElixirDropbox.Files.create_folder client, “/Path”
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-create_folder
create_folder_to_struct(Client, binary()) :: Map
Create folder returns Folder struct
Example
ElixirDropbox.Files.create_folder_to_struct client, “/Path”
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-create_folder
Delete the file or folder at a given path. If the path is a folder, all its contents will be deleted too. A successful response indicates that the file or folder was deleted. The returned metadata will be the corresponding FileMetadata or FolderMetadata for the item at time of deletion, and not a DeletedMetadata object.
Example
ElixirDropbox.Files.delete_folder client, “/Homework/math/Prime_Numbers.txt”
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-delete_v2
Delete folder returns Folder struct
Example
ElixirDropbox.Files.delete_folder_to_struct client, “/Path”
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-delete
Download a file from a user’s Dropbox.
Example
ElixirDropbox.Files.download client, “/mypdf.pdf”
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-download
Returns the metadata for a file or folder.
Example
ElixirDropbox.Files.get_metadata client, “/mypdf.pdf”
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata
Get a preview for a file.
Example
ElixirDropbox.Files.get_preview client, “/mypdf.pdf”
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-get_preview
Get a temporary link to stream content of a file. This link will expire in four hours and afterwards you will get 410 Gone. Content-Type of the link is determined automatically by the file’s mime type.
Example
ElixirDropbox.Files.get_temporary_link client, “/video.mp4”
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-get_preview
Get a thumbnail for an image.
Example
ElixirDropbox.Files.get_thumbnail client, “/image.jpg”
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-get_thumbnail
Get thumbnails for a list of images. We allow up to 25 thumbnails in a single batch.
Example
batch = %{ “path” => “/image.jpg”, “format” => “jpeg”, “size” => “w64h64”} entries = [batch] ElixirDropbox.Files.get_thumbnail_batch client, entries
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-get_thumbnail_batch
Move a file or folder to a different location in the user’s Dropbox. If the source path is a folder all its contents will be moved.
Example
ElixirDropbox.Files.move(client, “/Homework/math”, “/Homework/algebra”)
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-move
Restore a file to a specific revision.
Example
ElixirDropbox.Files.restore(client, “/root/word.docx”, “a1c10ce0dd78”)
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-restore
Searches for files and folders.
Example
ElixirDropbox.Files.search(client, “/root”, “word.docx”)
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-search
Create a new file with the contents provided in the request.
Example
ElixirDropbox.Files.upload client, “/mypdf.pdf”, “/mypdf.pdf”
More info at: https://www.dropbox.com/developers/documentation/http/documentation#files-upload