php - Updating Modifying File To Rackspace Cloud
560
How can I update files to rackspace api? I've tried several things like the code below, and it only works if I upload the image twice. Is there anyway of doing this?
public function updateRackSpaceFile($file_name, $file_location, $container_name='photos'){
$auth=self::getAuthorization();
$conn = new \CF_Connection($auth);
$container_object = $conn->get_container($container_name);
$object=$container_object -> get_object($file_name);
$object ->load_from_filename($file_location);
}
Answer
Solution:
I don't think you need to do a get on the object. Simply create a new object and upload. It will replace the object with the same name.