Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // include the Cloud API.
- require('cloudapi/cloudfiles.php');
- // Rackspace Connection Details;
- $username = "myusername"; // put username here
- $key = "mykey"; // api key
- // Connect to Rackspace
- $auth = new CF_Authentication($username, $key,NULL,UK_AUTHURL);
- $auth->authenticate();
- $conn = new CF_Connection($auth);
- //Set the Container you want to use
- $container = $conn->get_container('testing');
- //Temp store the file
- $localfile = $_FILES['uploadfile']['tmp_name'];
- $filename = $_FILES['uploadfile']['name'];
- //Uploading to Rackspace Cloud
- $object = $container->create_object($filename);
- $object->load_from_filename($localfile);
- echo "Your file has been uploaded";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement