Я пытаюсь загрузить файл в облачный файл стеллажа, используя следующий код:
Загрузить.html
<form action="upload.php" enctype="multipart/form-data" method="POST">
File:
<input name="upload" type="file" />
<input name="submit" type="submit" value="Upload To Rackspace!" />
</form>
Загрузить.php
<?php
// include the API
require('cloudfiles.php');
// cloud info
$username = ""; // username
$key = ""; // api key
// Connect to Rackspace
$auth = new CF_Authentication($username, $key);
$auth->authenticate();
$conn = new CF_Connection($auth);
// Get the container we want to use
$container = $conn->get_container('resumetune');
// store file information
$localfile = $_FILES['upload']['tmp_name'];
$filename = $_FILES['upload']['name'];
// upload file to Rackspace
$object = $container->create_object($filename);
$object->load_from_filename($localfile);
?>
Теперь я получаю сообщение об ошибке:
Неустранимая ошибка: необработанное исключение «BadContentTypeException» с сообщением «Требуемый тип контента не установлен» в C:\xampp\htdocs\rackspace\cloudfiles.php:1645 Трассировка стека: #0 C:\xampp\htdocs\rackspace\cloudfiles.php (1962): CF_Object->_guess_content_type('C:\xampp\tmp\ph...') #1 C:\xampp\htdocs\rackspace\upload.php(24): CF_Object->load_from_filename('C:\ xampp\tmp\ph...') #2 {main} добавлено в C:\xampp\htdocs\rackspace\cloudfiles.php в строке 1645
Так что у кого-нибудь есть идеи по этому поводу? заранее спасибо.