I am trying to check the response time with downloading some image file..
So I am using ASIHTTPRequest [request temporaryFileDownloadPath];
Will it download file in temp directory in iPhone and erase it automatically?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
temporaryFileDownloadPathis where the file is placed during the download. After the download, it will be copied from there to the location ofdownloadDestinationPath. If you setdownloadDestinationPathtoNSTemporaryDirectory(), then the file will be erased by the system automatically at some point.If you want to erase the file straight away though, just don’t set a
downloadDestinationPathor atemporaryFileDownloadPath, and it will be kept in memory and then deallocated when the request goes out of scope. If the image is too big to fit in memory, set adownloadDestinationPathsomewhere (doesn’t really matter, as long as it’s valid), and then after the download is finished remove the file from disk using[[NSFileManager defaultManager] removeItemAtPath:[request downloadDestinationPath] error:nil]. Pass in anNSError*to theerrorparameter to check if the delete encounters an error.