Unsolved
This post is more than 5 years old
12 Posts
0
3212
Atmos-PHP for PEER1 CloudOne - Creating, Listing & Uploading/Downloading Files
Hi all,
I'm using PEER1 CloudOne.
I can create an empty file in a PHP script using the atmos-php framework with this code:
$_files = new EsuRestApi( $host, $port, $uid, $secret );
$file = $_files->createObject( $acl = NULL, $metadata = NULL, $data = 'createObject data', $mimeType = 'text/plain');
echo 'Empty file created. The file id is '. $file .'';
How do you do this with the uploadHelper class?
Also, anybody know how to list files in the cloud via this framework via REST? I tried the following but got an error 1009.
$_files = new EsuRestApi( $host, $port, $uid, $secret );
try {
$_files->queryObjects('.jpg');
} catch (Exception $e) {
echo 'Error: ', $e->getMessage(), "\n";
echo 'Code: ', $e->getCode(), "\n";
}
That code returns:
Error: The method specified in the request is not allowed for the resource identified. Code: 1009
I don't even think I should post my uploadhelper code as it's obviously wrong...
Thanks!
mirando
12 Posts
0
July 15th, 2010 09:00
I was able to upload a file with the uploadHelper class to PEER 1 CloudOne storage:
I'm still working out the rest. Hope this helps somebody.
rbala1
222 Posts
1
July 19th, 2010 08:00
Mirando,
Have you seen the unit test included with the wrappers? The unit test should serve as a guide to implementing each method.
Raj
mirando
12 Posts
0
July 20th, 2010 09:00
Raj,
Thanks for that information. I wasn't able to run the test as it required PHPUnit, but I see the code now that you mention it. I thought it was part of the framework.
Cheers.
- Luis