Laravel Dropbox

Files

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.

Dropbox::files()->delete($path);

Create Folder

Pass the path to the folder to be created.

Dropbox::files()->createFolder($path)

Search Files

Each word will be used to search for files.

Dropbox::files()->search($query);

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.

Dropbox::files()->download($path);

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);

Copyright © 2006 - 2024 DC Blog - All rights reserved.