Below codes can get 1 single file from AWS 3 but, what about a folder?
var _key:int=Account.lessons[dl_i].id;
var dest:String = Conf.Dir+_key;
var request:G
The javascript code below will count the files inside a "folder"; in fact, it will list objects sharing the same part of the name, as @Viccari pointed out there is no folder. As data.Contents will be an array containing details on "the files inside the folder", you would then "get the folder".
var bucket = 'the_bucket_name';
var path_to_folder = 'path/to/the/folder/';
var params= {Bucket: bucket, Delimiter: path_to_folder };
s3.listObjects(params, function (err, data) {
if (err) {
console.log('Could not load objects from S3', err);
} else {
console.log('Loaded ' + data.Contents.length + ' items from S3');
}
});
For more details, see