Skip to content
This repository was archived by the owner on Apr 18, 2019. It is now read-only.
This repository was archived by the owner on Apr 18, 2019. It is now read-only.

Connect via token (upload file to one account) #93

Description

@nicolaszanghi

Hello Ben,

Thank you for your awesome work. It work pretty well. I manage to upload file to my account. But now i would like that all users send file to one dropbox account. For that I use the token from the dropbox App console.

But I get this error : Uncaught exception 'Dropbox\Exception' with message 'Access token not found.'

I don't understand what I'm suppose to put in oauth_token_secret.

Can you help me ?

This is my code in bootstrap.php :

    $key = 'mykey';
    $secret = 'mysecret';

    // Check whether to use HTTPS and set the callback URL
    $protocol = (!empty($_SERVER['HTTPS'])) ? 'https' : 'http';
    $callback = $protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

    // Instantiate the Encrypter and storage objects
    $encrypter = new \Dropbox\OAuth\Storage\Encrypter('ARANDOMSTRING');

    // Create the storage object, passing it the Encrypter object
    $storage = new \Dropbox\OAuth\Storage\Session($encrypter);

    // connect to send to concours account
    $token = new \stdClass();
    $token->oauth_token = 'mytoken';
    $token->oauth_token_secret = null;
    $storage->set($token, 'access_token');

    // Create the consumer and API objects
    $OAuth = new \Dropbox\OAuth\Consumer\Curl($key, $secret, $storage, $callback);

Many thanks !

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions