Giter Club home page Giter Club logo

dropbox's Introduction

Introduction

This repository contains a PHP SDK that provides access to the Dropbox REST API. The SDK conforms to the PSR-0 standard for autoloading interoperability and requires PHP >= 5.3.1. Unless otherwise stated, all components of the SDK are licensed under the MIT License.

Requirements

  • PHP >= 5.3.1
  • PHP cURL (\Dropbox\OAuth\Consumer\Curl)
  • PHP Mcrypt (\Dropbox\OAuth\Storage\Encrypter)
  • PHP PDO (\Dropbox\OAuth\Storage\DB)

Known Issues

  • A recent change to the PDO storage handler will require a calling code change or end users will need to re-authorise the application. See here for more information.
  • Due to PHP Bug #48962 affecting cURL, PHP >= 5.3.1 must be used until further consumers are available

Usage & Examples

Please see the examples provided.

Contributions & Flattr

A few people have asked me to add a Flattr button, so I have. Any contribution is much appreciated, but contributions to the community are much more valuable. Thanks to all those who have contributed their time, whether it's been to add a feature or raise an issue - it's much appreciated.

Flattr Button

dropbox's People

Contributors

benexile avatar eeroniemi avatar jschmid avatar mre avatar sfreytag avatar spiderr avatar wridgers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dropbox's Issues

Bootstrap.php autoload function parse error

Hey,

I tried your accountinfo.php example and the browser returned this error concerning your autoload function:

Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /mnt/webg/e2/24/52993124/htdocs/apis/dropbox/examples/bootstrap.php on line 24

did I set something wrong?

I work with PHP Version 5.2.17

Thanks in advance,
Jo

Access all folders

Hi,
I'm trying to upload a file into a specific folder in my dropbox root, using:
$put = $dropbox->putFile($tmp, 'api_upload_test.txt', 'MyFolder');

I get always the error message: 'App folder (sandbox) access attempt failed because this app is not configured to have an app folder. Should your access type be 'dropbox' instead? (Status Code: 403)'.

The app was created with the setting Access type Full Dropbox.

How do I switch the access type in my app? I don't find any option for that in the bootstrap.php

Thanks, any support is appreciated.

How to create folder?

hai,
How can i create a folder in drop box home directry

$dropbox->createFolder() not working

code:-

$dropbox->createFolder('new_folder','dropbox');

o/p:-

Fatal error: Call to undefined method Dropbox\API::createFolder() in /home/xxxxxxx/public_html/test/Dropbox/examples/sample.php on line 42

plz help.....

Uplaod uin my account

I want to upload from a web form, files to my Dropbox folder.

My problem is I always ask q are logged into does not use my account information to log.

And would require that anyone from anywhere up my account info.

How I can fix this?

Just wondering if I can access files in the dropbox folder using your sdk

Hi,

Thanks for the sdk. I was planning to use it in my project. I did see your examples. It shows how to upload file and see account info. Is there any method to retrieve folder names and filenames. And also download it to my server using the php sdk when requested. Is this possible using your sdk.

I appreciate all your help.

Thanks.

Writing file from file upload form.

Hi Ben, thanks for supplying the code!

I'm having trouble writing a file to my Dropbox account using an upload input in a form. The file is being uploaded properly, and a file named "test.jpg" is being created in Dropbox, but the file created on Dropbox is broken and without contents. My code is below...is there something I've done wrong?

    function handle_uploaded_file()   {

$protocol = (!empty($_SERVER['HTTPS'])) ? 'https' : 'http';
$callback = $protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

spl_autoload_register(function($class){
    $class = str_replace('\\', '/', $class);
    $var = include_once(TEMPLATEPATH . '/api/Dropbox/' . $class . '.php');
});

$encrypter = new \Dropbox\OAuth\Storage\Encrypter('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
$storage = new \Dropbox\OAuth\Storage\Session($encrypter);
$OAuth = new \Dropbox\OAuth\Consumer\Curl(DROPBOX_KEY, DROPBOX_SECRET, $storage, $callback);
$dropbox = new \Dropbox\API($OAuth,'dropbox');


$tmp = tempnam('/tmp', 'dropbox');

fwrite($tmp, $_FILES["uploaded_file"]["tmp_name"]);

$put = $dropbox->putFile($tmp,"test.jpg");

fclose($tmp); // this removes the file

    }

Fatal error App folder (sandbox) access attempt failed because this app is not configured to have an app folder.

how to resolve this?

( ! ) Fatal error: Uncaught exception 'Dropbox\Exception' with message 'App folder (sandbox) access attempt failed because this app is not configured to have an app folder. Should your access type be 'dropbox' instead? (Status Code: 400)' in E:\Dropbox\xampp\htdocs\PHP Program\BenTheDesigner-Dropbox-335d6d7\Dropbox\OAuth\Consumer\Curl.php on line 103
( ! ) Dropbox\Exception: App folder (sandbox) access attempt failed because this app is not configured to have an app folder. Should your access type be 'dropbox' instead? (Status Code: 400) in E:\Dropbox\xampp\htdocs\PHP Program\BenTheDesigner-Dropbox-335d6d7\Dropbox\OAuth\Consumer\Curl.php on line 103
Call Stack

Time Memory Function Location

1 0.0021 334240 {main}( ) ..\metaData.php:0
2 1.4112 647032 Dropbox\API->metaData( ) ..\metaData.php:17
3 1.4112 647920 Dropbox\API->fetch( ) ..\API.php:195
4 1.4112 647920 Dropbox\OAuth\Consumer\Curl->fetch( ) ..\API.php:419

Simultaneouse upload

I've found that if I put a file to 2 (or more) users in the same time. One will upload and another will queue. Second one will upload until previous one complete. Is it possible to upload simultaneously?

GetAccessToken

When trying to use the function i get this error:
Fatal error: Uncaught exception 'Dropbox\Exception' with message 'Request token not found. (Status Code: 401)'

Needs a way to delete the session and reconnect the session again

Hi Ben,

Excellent library. Our product is almost done except one bug (or something I don't understand with OAuth tokens. I need a way for the user to delete the connection with Dropbox via our third-party service. I figured I just delete the row in oauth_tokens table that you provided. Afterwards when trying to connect again, I get "Token is not an authorized request token. (Status Code: 403)" even if the token doesn't exist in the table.

I looked at all the issues on github and throughout the library for a way to delete the user tokens.

Is that something you will implement soon? Or is it something I don't understand with the way OAuth tokens work?

Thanks, and again, great work!

Edit: I should mention that if I change the Encryption key, everything works again. But I think this invalidates every oauth_tokens.

Edit 2: Ok, I figured out why I got this error. The $_SESSION variable was still using the old access token. Now it needs a way to delete that if we get a 403 error.

How to check of there is a token in DB?

Is it possible, with Dropbox and DB support, if there is a token in the DB?

I ask this, because i want to now if i need to ask the user to attach with Dropbox or that i don't need to bother the user with this question because we already have a (working) token saved.

I hoped that "storage->get('request_token')" would give me a token OR returns false, so i could add some logic on what to do next. But storage->get('request_token'); also redirects me to the dropbox site.

Maybe you can make it here also possible to redirect of let the function return false? This gives the users (me and the others) more room to play with the user experience.

With regards

slow putFile

Hey Ben,

Thanks for the awesome work you've done on this library. It's great!!

I have it working on my project, but it's taking forever (3-5 mins) to put files. The files I'm trying to store are just PDFs, about 200kb. Seems like that would be pretty quick.

Do you have any insight on what the issue could be? Or do you perhaps have some troubleshooting ideas?

Thanks in advance,
Andrew

Skip User Authorization?

I'd like to output a list of download links to files in one of my folders.

These links should be downloadable regardless of whether the visitor has a Dropbox account or not.

I can't seem to output my content without first obtaining an authorization token for a Dropbox user.

Is this possible?

unserialize() error

When I first try to authorize, then the the app come back to the callback URL and try to do for ex. $dropbox->accountInfo(); this message pops up:

A PHP Error was encountered
Severity: Notice
Message: unserialize() [function.unserialize]: Error at offset 0 of 192 bytes
Filename: Storage/Encrypter.php
Line Number: 69

What is it ? Where does it came from ? I googled after this and found:
http://davidwalsh.name/php-serialize-unserialize-issues
but it doesn't solve the issue applied to Encrypter class encrypt and decrypt functions.
However I get the account info but dont understand why it works, because every other operation works well after the forst authorization. Do you have any idea ?
I use Codeigniter by the way.

how to use with always the same dropbox, mine, and not the one of the visitor ?

Hello,

I can use your script, it seems very useful, and I can browse some my filders in my dropbox, but what I need to do is a webpage who display always the same folder of my Dropbox, vfor visitors, so that they can download some of my files

I wrote this script :


require_once('Dropbox/API.php');
require_once('Dropbox/OAuth/Consumer/ConsumerAbstract.php');
require_once('Dropbox/OAuth/Consumer/Curl.php');
require_once('Dropbox/OAuth/Storage/StorageInterface.php');
require_once('Dropbox/OAuth/Storage/Session.php');

$key = 'xxx'; // Your Consumer Key
$secret = 'xxx'; // Your Consumer Secret
$callback = 'my_url'; // Your Authorisation Callback URL

$storage = new \Dropbox\OAuth\Storage\Session;
$OAuth = new \Dropbox\OAuth\Consumer\Curl($key, $secret, $storage, $calllback);
$dropbox = new \Dropbox\API($OAuth);

// Upload the readme for this lib to the root of your dropbox
$dropbox->setRoot('dropbox');

$put = $dropbox->metadata($_GET['folder']);
$i=0;
while ($put->contents[$i]->path != '')
{
if ($put->contents[$i]->icon == 'folder')
echo "".$put->contents[$i]->path."";
else
{
echo $put->contents[$i]->path."";
}
$i++;
}


and it works, but when I connect whit another computer, it always go to the Dropbox page for authorisation, but I don't want the visitor going to this page and I want the page use my dropbox. How can I do that? is it possible ?

I hope it's clear enough, I'm not native...

thank you

regards,

matthieu collet

Can't get your code to work properly

Hi, I'm trying to get a simple task done (creating folders via your SDK) but I can't even get the examples to run properly.
Right out of the box, I try to run the putFile.php example and all it does it forward me to my Dropbox root directory without uploading any file.

One thing I've noticed is that the putFile.php code doesn't even get to the point of creating the temporary file. I think the code is failing somewhere within the bootstrap.php file, but it's not failing to the point of throwing an exception, I just get redirected to my root folder in Dropbox.

Any ideas what might be going on and what I can do to get this up and running?

I'm running the code off a GoDaddy.com account and the PHP version is 5.3.13.

Thanks in advance.

Will

Chunked upload does not upload on windows, but works fine on linux

Hi.

First i tested everything on linux , and it works fine .... but then i switched to windows , and encountered a problem with chunkedUpload function , though putFile works fine.

First error was 'Too long upload' , but as i understood if file is smaller than chunk , then it fails. Am i correct ?

But after supplying larger file i got another error ( Fatal error: Maximum execution time of 30 seconds exceeded in F:\xampp\htdocs\test\Dropbox\OAuth\Consumer\Curl.php on line 93 )


string 'HTTP/1.1 100 Continue

HTTP/1.1 200 OK
Server: nginx/1.2.3
Date: Tue, 02 Oct 2012 23:53:47 GMT
Content-Type: application/x-www-form-urlencoded
Transfer-Encoding: chunked
Connection: keep-alive
access-control-expose-headers: X-Dropbox-Metadata
pragma: no-cache
cache-control: no-cache
x-frame-options: SAMEORIGIN
access-control-allow-origin: *

oauth_token_secret=5ofp9wi15ybhkmk&oauth_token=q7j73ftoig9oa5d' (length=420)

resource(11, stream)
string 'HTTP/1.1 100 Continue

HTTP/1.1 500 Internal Server Error
Server: nginx/1.2.3
Date: Tue, 02 Oct 2012 23:54:04 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
pragma: no-cache
cache-control: no-cache

(length=256) ,
resource(15, stream)


Would be great if u can suggest something... Because i am not sure how to debug for example , the progress of file upload , exactly those chunks . And why it takes more than 30 seconds, timeouts , though the same file\function works fine on linux .... I am confused.

Just tried to set max_execution_time to 360 , basically 5 minutes and still get ' Dropbox\Exception: Internal Server Error (Status Code: 500) in F:\xampp\htdocs\test\Dropbox\OAuth\Consumer\Curl.php on line 106 '

HTTP/1.1 500 Internal Server Error
Server: nginx/1.2.3
Date: Wed, 03 Oct 2012 00:41:10 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
pragma: no-cache
cache-control: no-cache

{"error": "Internal Server Error"}' (length=290)

oauth_token parameter not found

We're trying to integrate this library into a Slim-based web app, and testing it here:

http://test.nimblehost.com/armadillo/files/armadillo/

To access the current implementation login with user: guest and password: guest -- then visit:

http://test.nimblehost.com/armadillo/files/armadillo/dropbox

Although you'll be directed to the Dropbox site correctly, when clicking "Allow" and being redirected back to our site, an error will occur stating that the oauth_token parameter can't be found. Trying to display var_dump($_SESSION['dropbox_api']); also results in an error, so I'm assuming the session variable is not being set correctly. We can, however, directly access the $_GET variables oauth_token and uid.

My guess is that some adjustment needs to be made when using this with a Slim-based app. Might you have any suggestions to that effect, or might this be something that should be handled in the library itself?

bootstrap.php neither returns nor redirects

Hello, first of all, thank you for providing us this sdk for a php development of dropbox apps.

I am trying to figure out how to make your kit work on my environment:

mac OSX 10.7.4
php 5.3.10
apache 2.2.21

once my process gets into a first time of bootstrap.php, it goes to authorize() in consumerAbstract.php with having a pair of oauth_token and oauth_token_sercret acquired from dropbox site as a part of query key value pairs stored in $url.

no redirection happens after exit; gets called. and because of this, an instantiation of $OAuth in bootstrap.php doee not get a control back from this process.

let me know how to make this work so that I can start accessing dropbox entities from my apps. thank you, Art

Timezone Problem

First, thank you for this. The code works great.

Now, my problem: In an array created by $dropbox-metaData all my files have the right time displayed but are in the wrong timezone. The timezone is set to Europe/Berlin.

Do you know how to change the timezone?

Thanks in advance.

Encryption of locally stored OAuth tokens

OAuth tokens allow an application to interact with a third-party service on behalf of a user. For this reason the ability to encrypt/decrypt OAuth access tokens stored to disk, database or otherwise must be provided, and they should be handled in the same sensitive manner as account passwords.

Tokens are required to generate signed requests, meaning a one-way hash function such as sha1 or md5 is not a viable solution. This functionality should be implemented in current and future storage handlers.

Check for headers not sent

Hi Ben,

I'm integrating your library in one of my webpage applications.
On some status page I do a check to see if the user has a connected Dropbox account.
To make this a bit smoother I would suggest you to add an extra condition to the authorise function in ConsumerAbstract.php:

Was: if (PHP_SAPI !== 'cli') {
Better: if ((PHP_SAPI !== 'cli') && (!headers_sent())) {

BTW: I've created a 'mysql.php' compatible to your 'session.php'. Code still needs some cleen up, but if you're interested I'm willing to make this code available.

Regards, Ivo

PDO Storage isn't working (for me at least)

I am working on a script that uses access tokens.
my current code is this

$encrypter = new \Dropbox\OAuth\Storage\Encrypter('60173754138144501737729dfd041f1i');//this is just a random key, not the one i'm actually using.
$userID = 1; // using a constant one for testing
$storage = new \Dropbox\OAuth\Storage\PDO($encrypter, $userID);
$storage->connect('localhost', 'dbname', 'user', 'pass');

$OAuth = new \Dropbox\OAuth\Consumer\Curl($key, $secret, $storage, $callback);
$dropbox = new \Dropbox\API($OAuth);
-------table structure------
dbname
    oauth_tokens
        userID
        token

however, nothing actually gets inserted into the table. Do I need to call the set method of the PDO helper, or is it something else. Thanks!

How save access token

Hello,

I am developing a PHP Script for content synching and it is running as a background process. But this Expiration of Access Token creates troubles for me, it requires a user interaction to click allow button for each new Web Session. Is there any method to avoid this user interaction and get a permanent Access Token for a Dropbox account. In my case i am using only one Dropbox account.

Bootstrap as a class

Is there a way to wrap this bootstrap into a class as to not have variables interfering with the rest of the code? I'm trying to do that but keep running into road blocks.

Suggestion: The integrated storage makes it a lot harder to modify the code. Storing tokens in a users database could be left to developers as a way to streamline this API.

Maybe something like this would be easier to integrate into applications.

$dropbox_client = new Dropbox_Client($token);
$dropbox = new Dropbox_API($dropbox_client);

Thanks for your work.

Encryption error

Hey, this looks fantastic but I'm having a little bit of trouble getting started. I'm getting a warning about open_basedir and certain curl functions (I know this is my Plesk server being stupid, even though I disabled open_basedir in both php.ini AND Apache httpd.conf, it is still in effect and I want to strangle it) but the second issue is an error:

Fatal error: Uncaught exception 'Dropbox\Exception' with message 'OAuthError in API v1+. Request mis-signed: Invalid or Missing Signature (Status Code: 401)'

Is this to do with curl/open_basedir do you think and not something I've done wrong in the bootstrap?

I replaced the XXXX with my public/private keys but I'm confused as to what the third placeholder XXXXXX is all about? The Encryptor one.

I'd really like to get started using this but I'm struggling so any help you can offer would be great.

Thanks!

Scott

Upload file within a folder

Hello,

In my drop box folder i have a folder named 'Public'. How can i upload a file within 'Public' folder using the API.

Encrypted (or not) token for examples

The test/setup.php stores the token without using the Encrypter function. The examples/bootstrap.php is using the Encrypter function. Thus the examples don't work after running the setup.php.

Please make the setup.php and examples compatible. It would make things more obvious for a new user.

Regards,
Ivo Mans

How can I see the File List of a root directory?

Hi, would you give any example about how we can get the file list of a dropbox directory, whether the folder or the file?
I'm still a newbie in this dropbox integration, so I would really appreciate a simple example on how to do it.

Thank's.

Credentials

Hi Ben,

Is it possible to supply credentials so that user does not have to admit the app each time he upload a new file? I am thinking on moving the upload to a queue as it take so long, and then user cannot hit any buttons for me...

Henrik

Too Confusing to use!

Hey,

This needs a hell of a lot more Documentation as it has caused me many headaches and I still haven't worked out how to use it properly!

I'm trying to build it into my own PHP Class but it isn't going well!

Please add more documentation! Maybe a wiki?

Needs a Wiki

Hello,

This is quite confusing to implement. Could you possibly put together a wiki here on GitHub will detailed instructions on how to use it?

Catchable fatal error: Object of class stdClass could not be converted to string in /Applications/XAMPP/xamppfiles/htdocs/dropbox/Dropbox-master/Dropbox/OAuth/Consumer/Curl.php on line 103

Hi,
In the examples, when I try to upload a small file to the server but get the following error Catchable fatal error: Object of class stdClass could not be converted to string in /Applications/XAMPP/xamppfiles/htdocs/dropbox/Dropbox-master/Dropbox/OAuth/Consumer/Curl.php on line 103. Please let me know what details you need to grab of my system.

Any help is greatly appreciated.
Cheers,
Sam

Uncaught exception 'Dropbox\Exception' with message 'Expecting a 32 byte key, got 15'

When trying to run examples/accountInfo.php I get the following error:

Fatal error: Uncaught exception 'Dropbox\Exception' with message 'Expecting a 32 byte key, got 15' in /Applications/MAMP/htdocs/testing/Dropbox/Dropbox/OAuth/Storage/Encrypter.php:39 Stack trace: #0 /Applications/MAMP/htdocs/testing/Dropbox/examples/bootstrap.php(38): Dropbox\OAuth\Storage\Encrypter->__construct('f5zbh1wef86ro3l') #1 /Applications/MAMP/htdocs/testing/Dropbox/examples/accountInfo.php(10): require_once('/Applications/M...') #2 {main} thrown in /Applications/MAMP/htdocs/testing/Dropbox/Dropbox/OAuth/Storage/Encrypter.php on line 39

I set the following in the bootstrap.php file:
$key, $secret and $encrypter = new \Dropbox\OAuth\Storage\Encrypter($key);

OAuth Access Grant

Hello please pardon my ignorance but I would like to use a single shared dropbox account in a business application that only requires access to be granted once and will be accessible across browsers and without expiration. Is this possible? It seems as though I can authenticate/grant access once in Chrome browser and functionality works fine but switching over to Firefox for testing requires that I re-authenticate. Is it possible to create the handshake once and not require it further unless I revoke in my Dropbox account?

Thank you in advance, Miro

Request mis-signed: Invalid or Missing Signature in accountInfo.php

Description

Hi,

I am planning on using your SDK, which by the way looks really good. After downloading it, the first thing I wanted to do was run some examples. After having set my app key and secret I ran accountInfo.php, just to check. To my surprise, I got a warning and an error. Since I have no clue what causes this, I was wondering if you can help me out here. I sincerely hope this is not something stupid... To try and solve the first warning, I have tried to switch off safe_mode and set open_basedir to the empty string, but that seemed not to have any effect. Also, of course, I have checked and double-checked my app key and secret.

Thanks in advance!
Thom

PHP output:

(slightly modified: stripped paths and app key/secret)

Warning: curl_setopt_array() [function.curl-setopt-array]: CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /.../Dropbox/OAuth/Consumer/Curl.php on line 89

Fatal error: Uncaught exception 'Dropbox\Exception' with message 'OAuthError in API v1+. Request mis-signed: Invalid or Missing Signature (Status Code: 401)' in /.../Dropbox/OAuth/Consumer/Curl.php:103
Stack trace
#0 /.../Dropbox/OAuth/Consumer/ConsumerAbstract.php(68): Dropbox\OAuth\Consumer\Curl->fetch('POST', 'https://api.dro...', '')
#1 /.../Dropbox/OAuth/Consumer/ConsumerAbstract.php(50): Dropbox\OAuth\Consumer\ConsumerAbstract->getRequestToken()
#2 /.../Dropbox/OAuth/Consumer/Curl.php(47): Dropbox\OAuth\Consumer\ConsumerAbstract->authenticate()
#3 /.../examples/bootstrap.php(42): Dropbox\OAuth\Consumer\Curl->__construct('my app key', 'my app secret', Object(Dropbox\OAuth\Storage\Session), 'http://www....')
#4 in /.../Dropbox/OAuth/Consumer/Curl.php on line 103

How do I get the absolute url?

Racking my brains here, and probably straight forward. but how do I get the full url to use with dropbox. Say i have an image - how would I get to display the image, or file. I can get a json response list but it will only show the name. ie /koala.jpg.

Say I am on localhost/dropbox/getfile.php - , and have an image in the root in sandbox mode. do I append something to the end. Or am I on the wrong direction here.

ie localhost/dropbox/getfile.php?file=koala.jpg.

I really need to get this quite urgent, but I think I am missing something really simple here.

Errors in ConsumerAbstract.php file

Hello,

I've got those errors in my webserver:

Notice: Undefined offset: 1 in ....../Dropbox/OAuth/Consumer/ConsumerAbstract.php on line 281
Fatal error: Cannot access empty property in ....../Dropbox/OAuth/Consumer/ConsumerAbstract.php on line 283

my hosted webserver has PHP Version 5.3.2 with cURL and mCrypt support.

Thanks for your help,

jM

Object-oriented Autoload Function

Hey,
is there a way to implement this special autoload function to include the unknown new class instances in a way, that it is possible to use the existing code in a self-written class?
I'd like to put all important things from bootstrap.php into the __construct() function of a class that needs connection to my Dropbox. The existing instanciating-syntax ("new \Dropbox.....") should work in this __construct() function afterwards.

Is that possible and if so, how?

Great project, thanks a lot for putting it on GitHub!

How can I test if user is connected to dropbox or not ?

is there any standard / inbuilt function to check if user is connected to dropbox or not?

I am implementing your code in one of my wordpress project. I want to sync with dropbox via ajax function if its connected else redirect to dropbox for acess token.

why first visite dropbox API should need to link to dropbox?

I have used another dropbox php api, that php api first visit also need to link dropbox, but it can save response in a file,then don't need to link to dropbox any more, Whether or not i delete the cookie or change a browser.

Does this api has the same function?

Encrypted key

Hi

I just set your Dropbox API and I noticed this line

$encrypter = new \Dropbox\OAuth\Storage\Encrypter('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');

What should I replace 'XXXX...' string with? Where can i find it?

am using your api and getting these error

putFile.php

/**

// Require the bootstrap
require_once('bootstrap.php');

// Create a temporary file and write some data to it
$tmp = tempnam('/tmp', 'dropbox');
$data = 'This file was uploaded using the Dropbox API!';
file_put_contents($tmp, $data);

// Upload the file with an alternative filename
$put = $dropbox->putFile($tmp, 'abc.txt');

print_r($put);

// Unlink the temporary file
unlink($tmp);

// Dump the output
var_dump($put);

errors:

Uncaught exception 'Dropbox\Exception' with message 'App folder (sandbox) access attempt failed because this app is not configured to have an app folder. Should your access type be 'dropbox' instead? (Status Code: 403)' in C:\wamp\www\BenTheDesigner-Dropbox-b49576c\Dropbox\OAuth\Consumer\Curl.php on line 103

( ! ) Dropbox\Exception: App folder (sandbox) access attempt failed because this app is not configured to have an app folder. Should your access type be 'dropbox' instead? (Status Code: 403) in C:\wamp\www\BenTheDesigner-Dropbox-b49576c\Dropbox\OAuth\Consumer\Curl.php on line 103

and also , is it necessary to define $encryter key in bootstrap.php ???
$encrypter = new \Dropbox\OAuth\Storage\Encrypter('XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');

Callback?

Hi Ben,

thanks for your lib which I was able to use out of the box, it gets the job done. Now for the refinements.

I only use putFile function/example but my files are pretty big, say 50MB so I would like to entertain the user with progress as the upload is progressing, to make him relax and trust, that all is well.

I was guessing some kind of callback function which would enable me to write x% done or similar.

Do you have an example for this?

Thanks Henrik

add input box to putfile

How can I go about implementing this.

$FilePath = "c:\user\test\koala.jpg";

$put = $dropbox->putFile($FilePath);

or

$put = $dropbox->putFile("c:\user\test\koala.jpg");

This works great.

How can I add a simple input box to get local file, and pass this to putfile.

Obviously cant use full path to security restrictions.

Speed

Hi Ben,

What kind of speed in the upload process can I expect. Everybody needs more, and maybe I am the same.... I upload a 5 Mb file in 15 sec. on a 20/20 connection - is that ok you think?

Sorry to trouble you on this....

Henrik

Let getAuthoriseUrl return a plaintext url

Why does getAuthoriseUrl(), in the test download, returns a plaintext url and redirect me in a browser?
I need the url, but i can't figure out why it redirects me in stead of returning a plaintext url.

Who can explain to me, how i can get this work?

Dropbox - Console

Hello everyone,

I run dropbox code by browser, it works, but when I run dropbox code by console, it doesn't work and no error
Thanks for any suggest, I'm just begginer :(

Best wishes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.