Kaynağa Gözat

Improvements

Marino Faggiana 7 yıl önce
ebeveyn
işleme
8b47867b59

+ 1 - 1
PickerFileProvider/FileProvider.swift

@@ -362,7 +362,7 @@ class FileProvider: NSFileProviderExtension {
             // Refresh
             self.refreshEnumerator(identifier: identifier, serverUrl: serverUrl)
             
-            // Copy file to Change Document & if exists on Import Documentr
+            // Copy file to Change Document & if exists on Import Document
             _ = self.copyFile(url.path, toPath: changeDocumentPath)
             if FileManager.default.fileExists(atPath: importDocumentPath) {
                 _ = self.copyFile(url.path, toPath: importDocumentPath)

+ 10 - 2
iOSClient/Networking/CCNetworking.m

@@ -1263,14 +1263,22 @@
             }
         }
         
-        // Delete [File Provider Storage / Change Document / fileName ]
+        // Delete [File Provider Storage / Change Document / fileName ] [File Provider Storage / Import Document / fileName ]
         if ([metadata.assetLocalIdentifier containsString:@"File Provider Storage"]) {
             
+            NSString *fileNamePath;
+            
             NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[NCBrandOptions sharedInstance].capabilitiesGroups];
             NSURL *dirFileProviderStorage = [dirGroup URLByAppendingPathComponent:k_assetLocalIdentifierFileProviderStorage];
+            
             NSURL *dirChangeDocument = [dirFileProviderStorage URLByAppendingPathComponent:k_fileProviderStorageChangeDocument];
-            NSString *fileNamePath = [NSString stringWithFormat:@"%@/%@", dirChangeDocument.path, metadata.fileName];
+            fileNamePath = [NSString stringWithFormat:@"%@/%@", dirChangeDocument.path, metadata.fileName];
+            [[NSFileManager defaultManager] removeItemAtPath:fileNamePath error:nil];
             
+            NSURL *dirImportDocument = [dirFileProviderStorage URLByAppendingPathComponent:k_fileProviderStorageImportDocument];
+            fileNamePath = [NSString stringWithFormat:@"%@/%@", dirImportDocument.path, metadata.fileName];
+            [[NSFileManager defaultManager] removeItemAtPath:fileNamePath error:nil];
+            fileNamePath = [NSString stringWithFormat:@"%@/%@.000", dirImportDocument.path, metadata.fileName];
             [[NSFileManager defaultManager] removeItemAtPath:fileNamePath error:nil];
         }