【问题标题】:Port Vimeo Upload PHP POST Request端口 Vimeo 上传 PHP POST 请求
【发布时间】:2012-05-04 06:59:31
【问题描述】:

我正在为客户端将 Vimeo PHP 库 https://github.com/vimeo/vimeo-php-lib 移植到 ColdFusion,并且已经成功地能够翻译除视频上传 POST 请求之外的所有内容。 PHP 库像这样使用 cURL:

$参数 = 数组( 'oauth_consumer_key' => $this->_consumer_key, 'oauth_token' => $this->_token, 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_timestamp' => 时间(), 'oauth_nonce' => $this->_generateNonce(), 'oauth_version' => '1.0', 'ticket_id' => $ticket, 'chunk_id' => $i ); // 生成 OAuth 签名 $params = array_merge($params, array( 'oauth_signature' => $this->_generateSignature($params, 'POST', self::API_REST_URL), 'file_data' => '@'.$chunk['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);

【问题讨论】:

    标签: php rest oauth vimeo


    【解决方案1】:

    不确定如何在 cfscript 中执行此操作,但您可以将文件指定为 cfhttpparam。

    <cfhttp url="something.com">
    <cfhttpparam type="file" file="c:\temp\myfile"/>
    </cfhttp>
    

    我错过了什么?

    【讨论】:

    • 太棒了...看到您的帖子后,我跑了出去并尝试了一些基于脚本的 cfhttp :) 我在大多数事情上都使用脚本,但我从来没有为 cfhttp 尝试过。
    猜你喜欢
    • 1970-01-01
    • 2021-08-10
    • 2021-03-11
    • 1970-01-01
    • 2013-01-18
    • 2012-02-20
    • 2020-10-25
    • 2015-06-01
    • 1970-01-01
    相关资源
    最近更新 更多