tags:

views:

519

answers:

3

I am successful in uploading to amazon s3 bucket using post and swf upload but can any one tell me how to upload to a subdirectory inside my bucket.

I am using php as my server side language.

Thanks in advance

A: 

As far as I know, there are no "folders" on amazon S3. It's simply a key-value pair thing. Any file structures, folders etc is up to the developer.

Jonatan Hedborg
You can have folders through buckets: http://www.codinghorror.com/blog/archives/000808.html
brianreavis
Oh ok, my bad. Disregard this :)
Jonatan Hedborg
A: 

If you're using the php-aws library, there's really not much to it:

$S3   = new S3(AWS_KEY, AWS_SECRET);
$from = 'fileonyourserver.ext';
$to   = '/path/to/place/in/inside/bucket/.../file.ext';
if ($S3->putObject(AWS_BUCKET, $to, $from, true)){
   //upload success
}
brianreavis
A: 

i got the same problem as well, it seems amazon s3 doesn't have folder concept, the workaround most people suggest is create a object with names like folder/test.txt.

vito huang