This package provides a clean way of working with files.

To work with files first call ->files() followed by a method.

Import Namespace

use Dcblogdev\Dropbox\Facades\Dropbox;

List Content

list files and folders of a given path

Dropbox::files()->listContents($path = '');

List Content Continue

Using a cursor from the previous listContents call to paginate over the next set of folders/files.

Dropbox::files()->listContentsContinue($cursor = '');

Delete folder/file

Pass the path to the file/folder, When deleting a folder all child items will be deleted.


Create Folder

Pass the path to the folder to be created.


Search Files

Each word will be used to search for files.


Upload File

Upload files to Dropbox by passing the folder path followed by the filename. Note this method supports uploads up to 150MB only.

Dropbox::files()->upload($path, $file);

Download File

Download file from Dropbox by passing the folder path including the file.


Move Folder/File

Move accepts 4 params:

$fromPath - provide the path for the existing folder/file $toPath - provide the new path for the existing golder/file must start with a / $autoRename - If there's a conflict, have the Dropbox server try to autorename the file to avoid the conflict. The default for this field is false. $allowOwnershipTransfer - Allow moves by owner even if it would result in an ownership transfer for the content being moved. This does not apply to copies. The default for this field is false.

Dropbox::files()->move($fromPath, $toPath, $autoRename = false, $allowOwnershipTransfer = false);

Help support the blog so that I can continue creating new content!

Fathom Analytics $10 discount on your first invoice using this link

Subscribe to my newsletter

Subscribe and get my books and product announcements.

© 2006 - 2023 DC Blog. All code MIT license. All rights reserved.