【发布时间】:2012-09-04 10:59:36
【问题描述】:
我在 PHP 中使用 Rackspace 云服务器的云文件 API,我想生成一个临时 url 来下载文件以直接到我的服务器,为此我正在使用此 api 的 get_temp() 方法,但在使用此方法之前我必须为我的容器设置元数据键。我该怎么做。
public function get_temp_url($key, $expires, $method)
{
$expires += time();
$url = $this->container->cfs_http->getStorageUrl() . '/' . $this->container->name . '/' . $this->name;
return $url . '?temp_url_sig=' . hash_hmac('sha1', strtoupper($method) .
"\n" . $expires . "\n" . parse_url($url, PHP_URL_PATH), $key) .
'&temp_url_expires=' . $expires;
}
【问题讨论】:
标签: php file-upload cloud rackspace