It looks like this was attempted to be fixed here #594 however it seems that this always results in 401 Unauthorized: Temp URL invalid because the URL doesn't have the container and file name in it.
As far as I can see if you use $forcePublicUrl below then it misses out on the extra things that DataObject::getUrl() adds to the URL path, namely the container and file name.
$url = ($forcePublicUrl === true) ? $this->getService()->getEndpoint()->getPublicUrl() : $this->getUrl();
(see https://github.com/rackspace/php-opencloud/blob/working/lib/OpenCloud/ObjectStore/Resource/DataObject.php#L484)
My work around for now is to ensure I instantiate the object store service with publicURL when wanting to generate temporary URLs for download.
It looks like this was attempted to be fixed here #594 however it seems that this always results in
401 Unauthorized: Temp URL invalidbecause the URL doesn't have the container and file name in it.As far as I can see if you use
$forcePublicUrlbelow then it misses out on the extra things thatDataObject::getUrl()adds to the URL path, namely the container and file name.$url = ($forcePublicUrl === true) ? $this->getService()->getEndpoint()->getPublicUrl() : $this->getUrl();(see https://github.com/rackspace/php-opencloud/blob/working/lib/OpenCloud/ObjectStore/Resource/DataObject.php#L484)
My work around for now is to ensure I instantiate the object store service with
publicURLwhen wanting to generate temporary URLs for download.