Dropbox FIle upload via API problem in PHP
I just stumbled over a problem u开发者_如何学Gosing the Dropbox API. Currently I am using the this lib: http://code.google.com/p/dropbox-php/
The problem is, if I upload a file I get a success but nothing arrives at the Dropbox. I also "hacked" into the library and changed some of the post stuff. I can post it if you want.
Anybody got a solution for that? Thanks!
//EDIT: I am using PHPs integrated OAuth functions //EDIT2:
<?php
include "class/Dropbox/autoload.php";
$oauth = new Dropbox_OAuth_PHP("xxxxxxxxxxx", "xxxxxxxxxxx");
$dropbox = new Dropbox_API($oauth);
//re-login
if(isset($_SESSION["oauth_tokens"])) {
$my->oauth->setToken($_SESSION["oauth_tokens"]);
}
//uploads itself to DB
if($dropbox->putFile( basename(__FILE__), __FILE__ )) {
echo "Success";
} else {
echo "Fail :(";
}
sure this is not the complete code but assume that the user is logged in. :)
Dropbox for PHP, the library you're using to upload files to Dropbox, isn't maintained anymore and therefore may not function properly.
Try out PHP Dropbox Uploader. It is mentioned on the official Dropbox wiki.
精彩评论