Commit a1200ef7 authored by Felix Paul Kühne's avatar Felix Paul Kühne

http file downloader: remove partially downloaded content if user cancels the process

parent 06abaa67
......@@ -113,6 +113,12 @@
- (void)cancelDownload
{
[_urlConnection cancel];
/* remove partially downloaded content */
NSFileManager *fileManager = [NSFileManager defaultManager];
if ([fileManager fileExistsAtPath:_filePath])
[fileManager removeItemAtPath:_filePath error:nil];
if ([self.delegate respondsToSelector:@selector(downloadFailedWithErrorDescription:)])
[self.delegate downloadFailedWithErrorDescription:@"Download canceled by user"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment