php - Codeigniter dropbox api -
i tried make upload in codeigniter jimdoescode library got error:
a php error encountered
severity: 8192
message: curl_setopt(): usage of @filename api file uploading deprecated. please use curlfile class instead
filename: libraries/dropbox.php
line number: 493
code in library curl is:
private function _connect($url, $header, $request, $postdata = false, $destination = false) { $ch = curl_init($url); curl_setopt($ch, curlopt_httpauth, curlauth_basic ) ; curl_setopt($ch, curlopt_sslversion, 1); // require tls curl_setopt($ch, curlopt_ssl_verifypeer, true); curl_setopt($ch, curlopt_ssl_verifyhost, 2); curl_setopt($ch, curlopt_cainfo, __dir__."/certs/trusted-certs.crt"); curl_setopt($ch, curlopt_capath, __dir__."/certs/"); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_customrequest, $request); curl_setopt($ch, curlopt_httpheader, explode(self::line_end, $header)); curl_setopt($ch, curlinfo_header_out, true); if(is_array($postdata)) { curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $postdata); } $response = curl_exec($ch); if(self::debug) { error_log(print_r(curl_getinfo($ch), true)); error_log($response); } $code = curl_getinfo($ch, curlinfo_http_code); curl_close($ch); //if content request write file if($destination !== false) { //if response write //the file , return true if($code == '200') { $fh = fopen($destination, 'w'); fwrite($fh, $response); if($fh !== false) { fclose($fh); return true; } } //the response bad or file couldn't //be written return false. return false; } else return $response; }
can me this, cause not familiar this.
Comments
Post a Comment