Beispiel #1
0
 /**
  * Tests Dropbox->filesPost()
  */
 public function testFilesPost()
 {
     $this->assertTrue($this->dropbox->filesPost(BASE_PATH, realpath('/Users/tijs/Projects/dropbox/dropbox.php')));
     $this->assertTrue($this->dropbox->filesPost(BASE_PATH, realpath('/Users/tijs/Projects/dropbox/tests/with spaces.txt')));
     $this->assertTrue($this->dropbox->filesPost(BASE_PATH . 'with spaces', realpath('/Users/tijs/Projects/dropbox/tests/with spaces.txt')));
     // cleanup
     $this->dropbox->fileopsDelete(BASE_PATH . 'dropbox.php');
     $this->dropbox->fileopsDelete(BASE_PATH . 'with spaces.txt');
     $this->dropbox->fileopsDelete(BASE_PATH . 'with spaces/with spaces.txt');
 }
Beispiel #2
0
            // Upload

            //$uploader = new Dropbox('*****@*****.**','initpass');

            $dropbox = new Dropbox('0b6mkq8ervg1zd5', 'p9tgw4dpb57e0eh');

            $uploader = $dropbox->token('*****@*****.**', 'initpass');



            $dropbox->setOAuthToken($uploader['token']);

            $dropbox->setOAuthTokenSecret($uploader['secret']);

            $response = $dropbox->filesPost('resumes', $tmpFile);



            // output response

            if(!$response['result'] == "winner!") {

                throw new Exception('Error on the upload to Dropbox!');

            }



        } catch(Exception $e) {