【问题标题】:RackSpace Cloudfiles api error 'Undefined offset: 8'RackSpace Cloudfiles api 错误“未定义的偏移量:8”
【发布时间】:2011-06-21 13:33:19
【问题描述】:

尝试将文件上传到 rackspace 云文件时,我收到此错误。 我试图追踪错误的来源,并假设它来自这行代码:

$container = $conn->get_container('test');

这是我得到的完整错误:

Notice
Undefined offset: 8
File: /dm/cloudfiles/cloudfiles.php, Line: 1588

这是上传的代码:

<?php
// include the Cloud API.
require('cloudfiles/cloudfiles.php');

// Rackspace Connection Details;
// cloud info
$username = "tariehk"; // username
$key = ""; // api key

// Connect to Rackspace
$auth = new CF_Authentication($username, $key);

$auth->authenticate();
$conn = new CF_Connection($auth);

//Set the Container you want to use
$container = $conn->get_container('dm');

//Temp store the file
$localfile = $_FILES['uploadfile']['tmp_name'];
$filename = $_FILES['uploadfile']['name'];

 //exit();
//Uploading to Rackspace Cloud
$object = $container->create_object($filename);
$object->load_from_filename($localfile);

echo "Your file has been uploaded";
?>

【问题讨论】:

    标签: api rackspace cloudfiles


    【解决方案1】:

    这个问题已经在他们的 repo 中修复了,但是在下载版本中仍然存在。

    修复可以在这里找到

    https://github.com/towynlin/php-cloudfiles/commit/02a8c658db7e9969b35bb57c47ede232521a6617

    https://github.com/towynlin/php-cloudfiles/commit/78c5d612fb5a7037e92f61acfaf10b59e09239e8

    错误报告在这里 https://github.com/rackspace/php-cloudfiles/pull/23

    只有几行,我自己修补的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-03-13
      • 1970-01-01
      • 2011-01-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多