title: Image Upload to rackspace cloud files using PHP
body: <p>I am trying to upload file to rackspace cloud file using the following code:</p>
  
  <p>Upload.html</p>
  
  <pre><code>&lt;form action="upload.php" enctype="multipart/form-data" method="POST"&gt;
      File: 
      &lt;input name="upload" type="file" /&gt; 
      &lt;input name="submit" type="submit" value="Upload To Rackspace!" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Upload.php</p>
  
  <pre><code>&lt;?php
  
  // include the API
  require('cloudfiles.php');
  
  // cloud info
  $username = ""; // username
  $key = ""; // api key
  
  // Connect to Rackspace
  $auth = new CF_Authentication($username, $key);
  $auth-&gt;authenticate();
  $conn = new CF_Connection($auth);
  
  // Get the container we want to use
  $container = $conn-&gt;get_container('resumetune');
  
  // store file information
  $localfile = $_FILES['upload']['tmp_name'];
  $filename  = $_FILES['upload']['name'];
  
  // upload file to Rackspace
  $object = $container-&gt;create_object($filename);
  $object-&gt;load_from_filename($localfile);
  
  ?&gt;
  </code></pre>
  
  <p>Now i am getting the gollowing error:</p>
  
  <p>Fatal error: Uncaught exception 'BadContentTypeException' with message 'Required Content-Type not set' in C:\xampp\htdocs\rackspace\cloudfiles.php:1645 Stack trace: #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} thrown in C:\xampp\htdocs\rackspace\cloudfiles.php on line 1645</p>
  
  <p>So any one have any idea about this? thanks in advance.</p>