使用PHP将网站+数据库上传到dropbox

时间:2011-08-29 19:33:57

标签: php upload dropbox

有没有人知道,如果可以将我的网站和数据库备份到带有php或其他东西的Dropbox帐户? 如果有可能,我怎么能以最好的方式做到这一点? : - )

最诚挚的问候 西蒙

2 个答案:

答案 0 :(得分:2)

是的,请查看dropbox-php

文档中的示例代码:

/* Please supply your own consumer key and consumer secret */
$consumerKey = '';
$consumerSecret = '';

include 'Dropbox/autoload.php';

session_start();
$oauth = new Dropbox_OAuth_PHP($consumerKey, $consumerSecret);

// If the PHP OAuth extension is not available, you can try
// PEAR's HTTP_OAUTH instead.
// $oauth = new Dropbox_OAuth_PEAR($consumerKey, $consumerSecret);

$dropbox = new Dropbox_API($oauth);

$dropbox->putFile('newPath.txt','/local/path/tofile');

答案 1 :(得分:1)

是的,这是可能的。 您需要Lars的解决方案和Dropbox的网络服务器, 检查https://github.com/louissobel/Drapache