Port Vimeo上传PHP POST请求
我正致力于将Vimeo PHP库https://github.com/vimeo/vimeo-php-lib移植到客户端的ColdFusion,并成功地转换了除视频上传POST请求之外的所有内容。 PHP lib像这样使用cURL:
$params = array( 'oauth_consumer_key' => $this->_consumer_key, 'oauth_token' => $this->_token, 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_timestamp' => time(), 'oauth_nonce' => $this->_generateNonce(), 'oauth_version' => '1.0', 'ticket_id' => $ticket, 'chunk_id' => $i ); // Generate the OAuth signature $params = array_merge($params, array( 'oauth_signature' => $this->_generateSignature($params, 'POST', self::API_REST_URL), 'file_data' => '@'.$chunk['file'] // don't include the file in the signature )); // Post the file $curl = curl_init($endpoint); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $params); $rsp = curl_exec($curl); curl_close($curl);
不知道如何在cfscript中做到这一点,但你可以指定文件为cfhttpparam。
<cfhttp url="something.com">
<cfhttpparam type="file" file="c:tempmyfile"/>
</cfhttp>
我错过了什么?
链接地址: http://www.djcxy.com/p/35843.html