0

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

$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";
?>
4

1 回答 1

0

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

修复程序可以在这里找到

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

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

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

就这么几行,我自己打的。

于 2011-08-17T23:57:25.357 回答