|
@@ -282,7 +282,7 @@ class FileProvider: NSFileProviderExtension {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- _ = ocNetworking?.downloadFileNameServerUrl("\(directory.serverUrl)/\(metadata.fileName)", fileNameLocalPath: "\(directoryUser)/\(metadata.fileID)", communication: CCNetworking.shared().sharedOCCommunicationExtensionDownload(metadata.fileName), success: { (lenght) in
|
|
|
+ let task = ocNetworking?.downloadFileNameServerUrl("\(directory.serverUrl)/\(metadata.fileName)", fileNameLocalPath: "\(directoryUser)/\(metadata.fileID)", communication: CCNetworking.shared().sharedOCCommunicationExtensionDownload(metadata.fileName), success: { (lenght) in
|
|
|
|
|
|
if (lenght > 0) {
|
|
|
|
|
@@ -312,6 +312,12 @@ class FileProvider: NSFileProviderExtension {
|
|
|
completionHandler(NSFileProviderError(.serverUnreachable))
|
|
|
})
|
|
|
|
|
|
+ if task != nil {
|
|
|
+ NSFileProviderManager.default.register(task!, forItemWithIdentifier: NSFileProviderItemIdentifier(identifier)) { (error) in
|
|
|
+ print("Registe download task")
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
} else {
|
|
|
|
|
|
// Exists
|