diff --git a/Dropbox/OAuth/Consumer/Curl.php b/Dropbox/OAuth/Consumer/Curl.php index 28d9dc2..ba52e44 100644 --- a/Dropbox/OAuth/Consumer/Curl.php +++ b/Dropbox/OAuth/Consumer/Curl.php @@ -74,6 +74,14 @@ public function fetch($method, $url, $call, array $additional = array()) { // Get the signed request URL $request = $this->getSignedRequest($method, $url, $call, $additional); + + if (function_exists('curl_file_create')) { + foreach ($request['postfields'] as $name => &$value) { + if (preg_match('/^@(?.+);filename=(?.+)$/', $value, $matches)) { + $value = curl_file_create($matches['file'], 'application/octet-stream', $matches['filename']); + } + } + } // Initialise and execute a cURL request $handle = curl_init($request['url']);