This page provides instructions for setting up Cloud Files module to upload files on Rackspace CloudFiles.

The instructions assume you already have a Rackspace Cloud file account with a Container created for storing your Drupal files.

  1. Download and Install Cloud Files module (dev version) on your Drupal site
  2. Open readme.txt from module folder and follow instructions.
  3. Download the php-opencloud library files from: http://php-opencloud.com/ and place it in sites/all/libraries/php-opencloud/.
  4. Using Composer (http://getcomposer.org/), run "composer require rackspace/php-opencloud:dev-master" from inside sites/all/libraries/php-opencloud/
  5. Enable the module
  6. Go to /admin/config/media/cloud-files and choose appropriate authentication URL.
  7. Enter username. It will be same as your username on https://mycloud.rackspace.com/
  8. Enter the API key that you generated on https://mycloud.rackspace.com/
  9. Container name will be same as the one you saved in https://mycloud.rackspace.com/
  10. Save configuration
  11. Go to admin/config/media/file-system
  12. Select the 'default download method' as 'Rackspace cloud files' and save
  13. Go to your content type and choose manage fields
  14. Create and/or Edit image field type
  15. go to 'upload destination' and select 'rackspace cloud files' and save
  16. you are done :)

Troubleshooting:
If you can not get it to work, then please ensure that

  1. PHP 5.4 or greater is installed in your environment
  2. You have enabled Publish to CDN setting on your Rackspace Cloudfiles container.
  3. Your API Key, Container and Location settings are correct.

Comments

akalam’s picture

Thanks for your tutorial but it only works if the rackspace container is created within the region Dallas (DFW) if you choose Chicago (ORD) or Sydney (SYD) it doesn't work

Tim Banks’s picture

Rackspace services talk to each other over an internal network. Are you hosting your site or using multiple Rackspace services (CDN, Database, Hosting) in your setup as well?

Its just a hunch but this setup may only work if your services are in the same region. e.g A CDN and the files container need to be both using the Dallas region.

Matt B’s picture

Does this solution work for public files or securely for private files as well?

Shane Birley’s picture

I can't find a whole lot on this yet as it launched a couple of days ago. Rackspace just launched Rackspace CDN which is an origin pull service. It looks pretty good but let's see how this changes things with Cloud Files (which this is built upon).

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com