将修改文件更新到 Rackspace 云
如何将文件更新到rackspace api?我已经尝试了几种方法,例如下面的代码,并且只有当我上传图像两次时它才有效。有办法这样做吗?
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);
}
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);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你不需要对这个对象进行获取。只需创建一个新对象并上传即可。它将替换具有相同名称的对象。
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.