Richard Fogal - 2012-06-10 22:48:25
Here is the code:
//Includes the CloudFiles PHP API.. Ensure the API files are located in your Global includes folder or in the same directory
require('cloudfiles.php');
//Now lets create a new instance of the authentication Class.
$auth = new CF_Authentication('UsernameGoesHere','APIKeyGoesHere');
//Calling the Authenticate method returns a valid storage token and allows you to connect to the CloudFiles Platform.
$auth->authenticate();
//The Connection Class Allows us to connect to CloudFiles and make changes to containers; Create, Delete, Return existing containers.
$conn = new CF_Connection($auth);
//Lets go ahead and create container.
$cont = $conn->create_container('PutContainerNameHere');
//Now lets make a new Object
$obj = $cont->create_object('PutObjectNameHere');
//Now lets put some stuff into the Object =)
$obj->write('LetsPutSomeDataHere');
I need to write files where it says 'LetsPutSomeDataHere'. Any advice?