8

I'm trying to create a smooth solution for sharing files with a custom presentation of the files (logos fonts etc).

My ideal would be to put the files in a dropbox folder and then have a webpage, on a separate server, access those files over javascript and display a list of them linked to the actual files.

A demand is that the end user don't have to authenticate with a dropbox acocunt in order to access the files. I would rather like to use a public folder or use files from another account.

Is there any way to maintain a auth-session serverside, something like a permanent sessionID or something like that?

4
  • Not that I am aware of, however, you could use CURL to reauthenticate with each request. Review: Wordpress Dev Network
    – Justin E
    Commented Oct 28, 2013 at 13:34
  • How is that done, isn't the authentification done in a form on dropbox.com?
    – Himmators
    Commented Oct 28, 2013 at 13:36
  • You will probably need to get an authorization code for your app, and hard code it, since youare okay with using the same drop box account, or public folder...so that account will need to approve you app, then simply hard code that into your PHP Script. Just skip over the parts asking for a authkey and hard code it to a variable.
    – Justin E
    Commented Oct 28, 2013 at 13:40
  • Just do the authentication one time, approve your app, get your authentication key, and in the code: $dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0"); $accountInfo = $dbxClient->getAccountInfo(); print_r($accountInfo); change: "$accessToken" to your authentication key, or put the line: "$accessToken = "{authentication code here}"; above that code...
    – Justin E
    Commented Oct 28, 2013 at 13:43

1 Answer 1

9

Just do the authentication one time, approve your app, get your authentication key, and in the code:

$dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
$accountInfo = $dbxClient->getAccountInfo();
print_r($accountInfo);

Change:

$accessToken to "{Your auth key}"

or put the line:

$accessToken = "{authentication code here}";

above that code.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.