尝试将文件上传到机架空间云文件时,我收到此错误。我试图追踪错误的来源,并假设它来自这行代码:
$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";
?>