Search code examples
phpibm-cloud-infrastructure

Get object size in softlayer


how I can get object size from softlayer object storage using PHP client without downloading object to my server?

I had tried:

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

but in this case object was downloaded to my server.


Solution

  • try using getInfo instead get example:

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

    Regards