php - Dropbox api not working in codiegniter? -
public function request_dropbox() { $params['key'] = 'gr3kempuvsiqsli'; $params['secret'] = 'qtdl8lmm9r0rlk1'; $this->load->library('dropbox', $params); $data = $this->dropbox->get_request_token(base_url()); $this->session->set_userdata('token_secret', $data['token_secret']); redirect($data['redirect']); } //this method should not called directly, called after //the user approves application , dropbox redirects public function access_dropbox() { $params['key'] = 'gr3kempuvsiqsli'; $params['secret'] = 'qtdl8lmm9r0rlk1'; $this->load->library('dropbox', $params); $oauth = $this->dropbox->get_access_token($this->session->userdata('token_secret')); $this->session->set_userdata('oauth_token', $oauth['oauth_token']); $this->session->set_userdata('oauth_token_secret', $oauth['oauth_token_secret']); redirect('welcome/test_dropbox'); } //once application approved can proceed load library //with access token data stored in session. if see account //information printed out have authenticated //dropbox , can use library interact account. public function test_dropbox() { $params['key'] = 'gr3kempuvsiqsli'; $params['secret'] = 'qtdl8lmm9r0rlk1'; $params['access'] = array('oauth_token'=>urlencode($this->session->userdata('oauth_token')), 'oauth_token_secret'=>urlencode($this->session->userdata('oauth_token_secret'))); $this->load->library('dropbox', $params); $dbobj = $this->dropbox->account(); print_r($dbobj); }
blockquote have used dropbox library https://github.com/jimdoescode/codeigniter-dropbox-api-library when call function request_dropbox() gives me error in api "fatal error: call undefined function curl_init() in c:\xampp\htdocs\reports\application\libraries\dropbox.php on line 478" please me how access dropbox files.
please @ errors more carefully, turns out curl not enabled on xampp environment.
this should out enable curl , going again.
Comments
Post a Comment