2017 © Pedro Peláez
 

library dropbox

A simple dropbox sdk. one feature at a time.

image

kanel/dropbox

A simple dropbox sdk. one feature at a time.

  • Sunday, February 4, 2018
  • by elkaadka
  • Repository
  • 0 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

DropBox Api Client

End points are added one at the time, if you need one, shoot me an email or make a pull request, i'll be glad to add it or check your PR., (*1)

How it works

The client is the main DropBox API. It takes the access token as the only parameter, (*2)

``` php $client = new \Kanel\DropBox\Client('access_token');, (*3)


## 1. Upload This call uploads a file from your disk to dropbox If the file is <= 150Mb, it will be uploaded using this end point : https://www.dropbox.com/developers/documentation/http/documentation#files-upload If the file is > 150Mb an upload session is automatically created using the following end points : https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-start https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-append_v2 https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-finish ### 1.1 Basic upload ``` php $client = new Client('access_token'); $client->upload('/path/to/your/file', 'path/folder/dropbox');

Note that if the dropBox folder path is not specified, it defaults to / (root of your application folder), (*4)

1.2 Upload with parameters

Dropbox offers some upload parameters you might want to use when uploading a file. You can use the UploadParameters class:, (*5)

php $client = new Kanel\DropBox\Client('access_token'); $uploadParameter = new \Kanel\DropBox\Parameters\UploadParameters(); $uploadParameter->setAutoRenameFile(true); $client->upload('/path/to/your/file', 'path/folder/dropbox', $uploadParameter);, (*6)

The parameters that can be edited from the parameters are all listed here : https://www.dropbox.com/developers/documentation/http/documentation#files-upload You can check the class Kanel\DropBox\Parameters\UploadParameters for more info too, (*7)

One of the most important parameter here is $chunksSize This parameter allows you to change the size of chunks to upload when the file exceeds 150Mb., (*8)

If the file is > 150Mb the file will be split in chunks of $chunksSize and ech chunk uploaded using sessions, (*9)

php $client = new Kanel\DropBox\Client('access_token'); $uploadParameter = new \Kanel\DropBox\Parameters\UploadParameters(); $uploadParameter->setChunksSize(10485760); $client->upload('/path/to/your/file', 'path/folder/dropbox', $uploadParameter);, (*10)

In this example, if the file is > 150Mb, it will be split in 10Mb chunks and each chunk uploaded separately., (*11)

The Versions

04/02 2018

dev-master

9999999-dev

A simple dropbox sdk. one feature at a time.

  Sources   Download

The Requires

 

The Development Requires

by Adil El Kanabi

28/01 2018

0.1.1

0.1.1.0

A simple dropbox sdk. one feature at a time.

  Sources   Download

The Requires

 

The Development Requires

by Adil El Kanabi

28/01 2018

0.1

0.1.0.0

A simple dropbox sdk. one feature at a time.

  Sources   Download

The Requires

 

The Development Requires

by Adil El Kanabi