簡體   English   中英

如何使用其PHP API在Rackspace Cloud Files容器中的位置之間復制文件

[英]How to copy a file between locations in a Rackspace Cloud Files container with their PHP API

給定代碼

$this->cf_container->copy_object_to($file, $this->cf_container, $new_path . '/' . $file_subpath);

其中$ this-> cf_container是CF_Container類的對象,出現此錯誤:

“指定的對象'A random container / one / pow / whiskey.jpg'作為復制源不存在,或者'A random container'作為復制目標不存在。”

顯然,該容器的名稱是“隨機容器”。 我已經嘗試過使用不包含空格的容器來達到相同的效果。

如果我執行$ this-> cf_container-> get_object($ file),則會得到具有文件屬性的CF_Object對象,因此該對象存在。

$ file等於“ one / pow / whiskey.jpg” $ new_path等於“一個/ different_folder” $ file_subpath等於“ whiskey.jpg”

任何人有線索或曾經遇到過這個?

您可能想嘗試新的Rackspace PHP SDK (又名php-opencloud)。 php-cloudfiles最終將被棄用。

要在php-opencloud中復制對象,請簽出DataObject :: Copy 如果遇到問題,可以在此處提交問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM