RSS

create sub buckets on amazon s3

02 Oct

Sub buckets is very tricky task to create on Amazon S3 service…

<?php

include(“S3.php”); // class for REST based S3 manager

$s3 = new S3(‘accessKey’, ‘secretKey’);
$s3->putBucket(‘bucketname’, S3::ACL_PUBLIC_READ);

/* function to upload svnlabs.txt file to subfolders s/v/n/l/a/b/s on S3 bucketname */
$s3->putObjectFile(‘svnlabs.txt’, ‘bucketname’, ‘s/v/n/l/a/b/s/svnlabs.txt’, S3::ACL_PUBLIC_READ);

/* function to delete svnlabs.txt file to subfolders s/v/n/l/a/b/s on S3 bucketname */
//$s3->deleteObject(‘bucketname’, ‘s/v/n/l/a/b/s/svnlabs.txt’);

?>

Public URL for this file:
http://bucketname.s3.amazonaws.com/s/v/n/l/a/b/s/svnlabs.txt

Source: http://undesigned.org.za/2007/10/22/amazon-s3-php-class

Advertisements
 
 

Tags: , , , ,

2 responses to “create sub buckets on amazon s3

  1. Andy

    October 3, 2009 at 3:47 am

    I always enjoy learning what other people think about Amazon Web Services and how they use them. Check out my very own tool CloudBerry Explorer that helps to
    manage S3 on Windows . It is a freeware. http://cloudberrylab.com/

     
  2. Kidd Chaos

    February 28, 2011 at 7:11 pm

    Many thanks. This helped me.

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: