1
votes

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentPath = [paths objectAtIndex:0];

NSString *temp = [NSString stringWithFormat:@"%@/temp.txt", documentPath];
NSLog(temp);




// create our stream
NSOutputStream *outputStream =
[[NSOutputStream alloc] initToFileAtPath:temp append:YES];
[outputStream open];

// create our request
S3GetObjectRequest *getObjectRequest =
[[S3GetObjectRequest alloc] initWithKey:self.objectName
withBucket:self.bucket];
getObjectRequest.outputStream = outputStream;




// always make sure to close your streams when done
[outputStream close];
1
Where do you want it to go?Frederick Cheung
Doesn't really matter I just want to be able to view the file for verification that the transfer was successful.user2402616

1 Answers

2
votes

You will need to use NSSearchPathForDirectoriesInDomains to get the documents directory for your application and use it to build the file path and name.

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,     NSUserDomainMask, YES);
    NSString *documentPath = [paths objectAtIndex:0];