|
|
@@ -162,11 +162,11 @@
|
|
|
model.downloadBoxStateType = downloadBoxStateSuspend;
|
|
|
[weakSelf handleDownloadingStateTapFunBy:YES with:model];
|
|
|
}
|
|
|
- else if(model.downloadBoxStateType == downloadStateSuspend){
|
|
|
+ else if(model.downloadBoxStateType == downloadBoxStateSuspend){
|
|
|
model.downloadBoxStateType = downloadBoxStateDownloadloading;
|
|
|
[weakSelf handleDownloadingStateTapFunBy:NO with:model];
|
|
|
}
|
|
|
- else if(model.downloadBoxStateType == downloadStateFail){
|
|
|
+ else if(model.downloadBoxStateType == downloadBoxStateFail){
|
|
|
[weakSelf handleUploadFailStateWith:model];
|
|
|
}
|
|
|
};
|
|
|
@@ -524,6 +524,8 @@
|
|
|
[_downloadingArr addObject:model];
|
|
|
[self RefreshAllDataFun];
|
|
|
|
|
|
+ [[boxDownloadFileManager shareInstance] updataBoxSaveDataInFailBy:model];
|
|
|
+
|
|
|
NSString *urlString = model.fileUrl;
|
|
|
NSString *requestURLEncodedString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
|
|
[[SGDownloadManager shareManager] startDownLoadWithUrl:requestURLEncodedString];
|
|
|
@@ -781,7 +783,7 @@
|
|
|
|
|
|
}
|
|
|
else{//保存到文件
|
|
|
-
|
|
|
+ [self loadOtherDataFinishedBy:pathStr];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -826,55 +828,11 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
-////下载音频 文件等
|
|
|
-//- (void)loadOtherDataFinished
|
|
|
-//{
|
|
|
-// [[downloadManager shareInstance] DownloadFileDoneOneFileFun];
|
|
|
-//
|
|
|
-// NSString *fileName = [self.curDownloadFileModel getFileNameFun];
|
|
|
-// NSString*filePath = [cachesFileManager getFilePathWithName:fileName type:DownLoadFileType];
|
|
|
-//
|
|
|
-// if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]){
|
|
|
-// HLog(@"没有找到文件:%@",fileName);
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// NSURL * fileURL = [NSURL fileURLWithPath:filePath];
|
|
|
-// UIDocumentPickerViewController *documentPickerVC = [[UIDocumentPickerViewController alloc] initWithURL:fileURL inMode:UIDocumentPickerModeExportToService];
|
|
|
-// // 设置代理
|
|
|
-// documentPickerVC.delegate = self;
|
|
|
-// // 设置模态弹出方式
|
|
|
-// documentPickerVC.modalPresentationStyle = UIModalPresentationFormSheet;
|
|
|
-// [self.navigationController presentViewController:documentPickerVC animated:YES completion:nil];
|
|
|
-//}
|
|
|
-//
|
|
|
-//
|
|
|
-//#pragma mark - UIDocumentPickerDelegate
|
|
|
-//- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentsAtURLs:(NSArray<NSURL *> *)urls {
|
|
|
-// // 获取授权
|
|
|
-// BOOL fileUrlAuthozied = [urls.firstObject startAccessingSecurityScopedResource];
|
|
|
-// if (fileUrlAuthozied) {
|
|
|
-// // 通过文件协调工具来得到新的文件地址,以此得到文件保护功能
|
|
|
-// NSFileCoordinator *fileCoordinator = [[NSFileCoordinator alloc] init];
|
|
|
-// NSError *error;
|
|
|
-//
|
|
|
-// [fileCoordinator coordinateReadingItemAtURL:urls.firstObject options:0 error:&error byAccessor:^(NSURL *newURL) {
|
|
|
-// // 读取文件
|
|
|
-// NSString *fileName = [newURL lastPathComponent];
|
|
|
-// NSError *error = nil;
|
|
|
-// //NSData *fileData = [NSData dataWithContentsOfURL:newURL options:NSDataReadingMappedIfSafe error:&error];
|
|
|
-// if (error) {
|
|
|
-// // 读取出错
|
|
|
-// } else {
|
|
|
-// // 上传
|
|
|
-// NSLog(@"fileName : %@", fileName);
|
|
|
-// [cachesFileManager removeItemAtPath:fileName type:DownLoadFileType error:nil];
|
|
|
-// }
|
|
|
-// }];
|
|
|
-// [urls.firstObject stopAccessingSecurityScopedResource];
|
|
|
-// } else {
|
|
|
-// // 授权失败
|
|
|
-// }
|
|
|
-//}
|
|
|
+//下载音频 文件等
|
|
|
+- (void)loadOtherDataFinishedBy:(NSString*)fullPath
|
|
|
+{
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:NotLoadOtherDataFinished object:fullPath userInfo:nil];
|
|
|
+}
|
|
|
+
|
|
|
@end
|
|
|
|