在softlayer中获取对象大小

时间:2016-10-19 12:26:34

标签: php ibm-cloud-infrastructure

如何使用PHP客户端从软件对象存储中获取对象大小而不将对象下载到我的服务器?

我曾尝试过:

$objectStorage -> with('container/file')->get()->getHeader('Content-length');

但在这种情况下,对象已下载到我的服务器。

1 个答案:

答案 0 :(得分:0)

尝试使用getInfo代替示例:

$size = $objectStorage -> with('mycontainer/myfile.txt') -> getInfo() -> getHeader("Content-length");
print_r($size);

此致