objective c - ASIHTTPRequest (ASIS3ObjectRequest) - File not downloaded -
i'm having issue accessing downloaded file. can see downloaded data coming through using didreceivedata delegate method never see file in directory once request finished. also, fwiw i'm requesting .zip file bucket.
-(void)downloadzipfile { asis3objectrequest *request = [asis3objectrequest requestwithbucket:bucket key:keypath]; [request setsecretaccesskey:secretaccesskey]; [request setaccesskey:accesskey]; [request setdelegate:self]; [request setdownloaddestinationpath:[[self documentsdirectory] stringbyappendingpathcomponent:@"test.zip"]]; [request startsynchronous]; } - (void)requestfinished:(asihttprequest *)request { nserror *error; nsfilemanager *filemanager = [[nsfilemanager alloc] init]; nslog(@"documents directory: %@", [filemanager contentsofdirectoryatpath:[self documentsdirectory] error:&error]); //logging contents of documents directory shows file downloaded not there [filemanager release]; } - (nsstring *)documentsdirectory { nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); return [paths objectatindex:0]; }
any appreciated.
ah found problem.
first if you're writing data disk using downloaddestinationpath must remove didreceivedata delegate method implementation. make sure set temporarydownloadpath.
Comments
Post a Comment