Upload website + database to dropbox with PHP

南楼画角 提交于 2019-12-21 06:42:17

问题


Does anyone know, if it's possible to backup my website and database to a dropbox account with php or something? And if it's possible, how can I do it the best way? :-)

Best Regards Simon


回答1:


Yes it is, have a look at the dropbox-php.

Example Code from the documentation:

/* 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');



回答2:


Yep, that is possible. You need the solution from Lars and a webserver for your dropbox, check https://github.com/louissobel/Drapache



来源:https://stackoverflow.com/questions/7234934/upload-website-database-to-dropbox-with-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!