how to copy a directory using ASIS3Request

15 views
Skip to first unread message

Risma Dewi Suherman

unread,
Feb 2, 2012, 4:36:13 AM2/2/12
to ASIHTTPRequest, ri...@icodelabs.net
hi everyone, i'm developing a simple application that seems like AWSS3
client using ASIS3Request. But i have a problem in copying directory.
I can copy the directory name into another directory, but i cant get
all the files in the first directory. This is the code i made :

- (void) copyObjectWithKey:(NSString *)sourceKey FromBucket:(NSString
*)sourceBucket ToObject:(NSString *)destKey InToBucket:(NSString
*)destBucket withConnection:(RemoteConnection *)remoteModel{
NSLog(@"copy object s3 sourceKey : %@, sourcebucket : %@, destkey :
%@, destbucket : %@", sourceKey, sourceBucket, destKey, destBucket);

ASIS3ObjectRequest *request =
[ASIS3ObjectRequest COPYRequestFromBucket:sourceBucket
key:sourceKey
toBucket:destBucket key:destKey];
BOOL success;

[request setAccessKey:remoteModel.userName];
[request setSecretAccessKey:remoteModel.passWord];

[request startSynchronous];
if (![request error]) {
if (request.responseStatusCode >= 200 &&
request.responseStatusCode < 300) {
success = YES;
}
}
NSLog(@"error %@",[[request error] localizedDescription]);

}


and this is the print out from nslog above :

copy object s3 sourceKey : A/ris/new folder/
sourcebucket : bucketi
destkey : abru/new folder/
destbucket : bucketi

can somebody tell me, where's my mistake? or maybe give me some clues
to solve this problem.

FYI, i use that's code to copy a file, and it is success.

thank you.
Reply all
Reply to author
Forward
0 new messages