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

  • SEARCH
  • Home
  • 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

Related Questions

I'm trying to upload a file using PHP. My HTML page with the form
I'm trying to upload file, using XMLHTTPRequest, and sending this headers: Content-Type:multipart/form-data, boundary=xxxxxxxxx --xxxxxxxxx
friends, i am trying to upload file to php server using following tutorial http://getablogger.blogspot.com/2008/01/android-how-to-post-file-to-php-server.html
I am trying to upload file using dropbox api but following Code shows some
I'm trying to upload a file to an FTP server using code based on
I am trying to upload file to FTP server using php but it is
I am using html form below and on my local computer trying to upload
I'm trying to upload PHP file via php using ftp details as mentioned below.
I am trying to upload a file of 1GB size using php script and
I am trying to upload a file using php,and i need to pass a

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.