src/Dropbox/Dropbox.php
public function startUploadSession($dropboxFile, $chunkSize = -1, $close = false)
    {
        //Make Dropbox File with the given chunk size
        $dropboxFile = $this->makeDropboxFile($dropboxFile, $chunkSize);

        //Set the close param
        $params = [
            'close' => $close ? true : false,
            'file' => $dropboxFile
        ];

        //Upload File
        $file = $this->postToContent('/files/upload_session/start', $params);
        $body = $file->getDecodedBody();

        //Cannot retrieve Session ID
        if (!isset($body['session_id'])) {
            throw new DropboxClientException("Could not retrieve Session ID.");
        }

        //Return the Session ID
        return $body['session_id'];
    }
public function startUploadSession($dropboxFile, $chunkSize = -1, $close = false)
    {
        //Make Dropbox File with the given chunk size
        $dropboxFile = $this->makeDropboxFile($dropboxFile, $chunkSize);

        //Set the close param
        $params = [
            'close' => $close ? true : false,
            'file' => $dropboxFile
        ];

        //Upload File
        $file = $this->postToContent('/files/upload_session/start', $params);
        $body = $file->getDecodedBody();

        //Cannot retrieve Session ID
        if (!isset($body['session_id'])) {
            throw new DropboxClientException("Could not retrieve Session ID.");
        }

        //Return the Session ID
        return $body['session_id'];
    }
public function startUploadSession ( $ dropboxFile , $ chunkSize = - 1 , $ close = false ) { //Make Dropbox File with the given chunk size $ dropboxFile = $ this -> makeDropboxFile ( $ dropboxFile , $ chunkSize ) ; //Set the close param $ params = [ 'close' => $ close ? true : false , 'file' => $ dropboxFile ] ; //Upload File $ file = $ this -> postToContent ( '/files/upload_session/start' , $ params ) ; $ body = $ file -> getDecodedBody ( ) ; //Cannot retrieve Session ID if ( ! isset ( $ body [ 'session_id' ] ) ) { throw new DropboxClientException ( "Could not retrieve Session ID." ) ; } //Return the Session ID return $ body [ 'session_id' ] ; }
Start an Upload Session

@param  string|DropboxFile $dropboxFile DropboxFile object or Path to file
@param  int                $chunkSize   Size of file chunk to upload
@param  boolean            $close       Closes the session for "appendUploadSession"

@return string Unique identifier for the upload session

@throws \Kunnu\Dropbox\Exceptions\DropboxClientException

@link https://www.dropbox.com/developers/documentation/http/documentation#files-upload_session-start
Start an Upload Session