|
|
@@ -8,6 +8,7 @@
|
|
|
#import <UIKit/UIKit.h>
|
|
|
#import "RAUploadManager.h"
|
|
|
#import "NetworkUtils.h"
|
|
|
+#import "RAUtils.h"
|
|
|
|
|
|
@implementation RAUploadManager
|
|
|
|
|
|
@@ -86,7 +87,7 @@
|
|
|
|
|
|
[self stopTask:task];
|
|
|
NSError* error = nil;
|
|
|
- [fmanager removeItemAtPath:task[@"file_path"] error:&error];
|
|
|
+ [fmanager removeItemAtPath:[self filePath:task] error:&error];
|
|
|
}
|
|
|
[[self mutableArrayValueForKey:@"arr_queue"] removeObjectsInArray:tasks];
|
|
|
// if (self.delegate && [self.delegate respondsToSelector:@selector(uploadManager:didRemoveTasks:)]) {
|
|
|
@@ -100,7 +101,7 @@
|
|
|
// [self.arr_queue addObject:task];
|
|
|
[self stopTask:task];
|
|
|
NSError* error = nil;
|
|
|
- [fmanager removeItemAtPath:task[@"file_path"] error:&error];
|
|
|
+ [fmanager removeItemAtPath:[self filePath:task] error:&error];
|
|
|
|
|
|
[[self mutableArrayValueForKey:@"arr_queue"] removeObject:task];
|
|
|
// if (self.delegate && [self.delegate respondsToSelector:@selector(uploadManager:didRemoveTasks:)]) {
|
|
|
@@ -109,6 +110,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+-(NSString*)filePath:(NSMutableDictionary*)task
|
|
|
+{
|
|
|
+
|
|
|
+ NSString *path = [RAUtils appCacheDirectory];
|
|
|
+ path= [path stringByAppendingPathComponent:task[@"path"]];
|
|
|
+ path= [path stringByAppendingPathComponent:task[@"file"]];
|
|
|
+ return path;
|
|
|
}
|
|
|
-(void) stopTask:(NSMutableDictionary*) task
|
|
|
{
|