Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 626135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:23:08+00:00 2026-05-13T19:23:08+00:00

I am trying to upload file to rackspace cloud file using the following code:

  • 0

I am trying to upload file to rackspace cloud file using the following code:

Upload.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>

Upload.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);

?>

Now i am getting the gollowing error:

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

So any one have any idea about this? thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:23:08+00:00Added an answer on May 13, 2026 at 7:23 pm

    looking at http://github.com/rackspace/php-cloudfiles/blob/master/cloudfiles.php at the function _guess_content_type() it’s looking for the Content-type and it’s not finding it. Either you need to add more information to your /share/magic or you can probably set the Content-type before calling the load_from_filename if you know what the content type is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 347k
  • Answers 347k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer String objects are immutable. Calling concat on toList will not… May 14, 2026 at 6:20 am
  • Editorial Team
    Editorial Team added an answer A a; Creates an instance of an A that lives… May 14, 2026 at 6:20 am
  • Editorial Team
    Editorial Team added an answer Check your php.ini file for the output_buffering setting. If it's… May 14, 2026 at 6:20 am

Related Questions

I am trying to upload file to google sites and am obtaining the stream
I am trying to upload file to FTP server using php but it is
I am trying to upload a file to a sever using PHP. I cannot
I am trying to find out how to upload a file from a web
I am using Selenium RC with Junit framework. I am trying to upload a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.