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
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
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.
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
}
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.