我有一个控制器将图像上传到我的Web服务器。我希望在该过程中将该图像上传到Dropbox。我会怎么做?如何将文件从codeigniter应用程序上传到Dropbox
这是我简单的upload.php的控制器:
function index() {
// get the binary data
$file = file_get_contents("php://input");
// prepare new name for upload image
$name =rand().time().'jpg';
$path = site_url('photo');
// save to server directory
file_put_contents($path.$name, $file);
// save the name and id of the post to post photo table
$input = array( 'name' => $name,
'post_id'=> $id
);
$this->db->insert('post_photo', $input);
}
一个好的开始就是看[Dropbox API](https://www.dropbox.com/developers/core/start/php),甚至是专门为codeigniter编写的插件,[就像这样](https://github.com/jimdoescode/CodeIgniter-Dropbox-API-Library) – Darren 2015-04-01 07:40:32
Dropbox是否支持电子邮件上传Imgur文件?这将很容易设置 – Marie 2015-04-01 13:59:12