Marino Faggiana 6 jaren geleden
bovenliggende
commit
9d9179c5ad
2 gewijzigde bestanden met toevoegingen van 9 en 3 verwijderingen
  1. 1 1
      iOSClient/Networking/CCNetworking.m
  2. 8 2
      iOSClient/Text/NCText.swift

+ 1 - 1
iOSClient/Networking/CCNetworking.m

@@ -538,7 +538,7 @@
     
     if ([task isKindOfClass:[NSURLSessionUploadTask class]]) {
         
-        metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"account = %@ AND fileID = %@", _activeAccount, fileID]];
+        metadata = [[NCManageDatabase sharedInstance] getMetadataWithPredicate:[NSPredicate predicateWithFormat:@"directoryID = %@ AND fileName = %@", directoryID, fileName]];
         if (metadata) {
             
             NSDictionary *fields = [httpResponse allHeaderFields];

+ 8 - 2
iOSClient/Text/NCText.swift

@@ -159,8 +159,14 @@ class NCText: UIViewController, UITextViewDelegate {
                 
                     self.dismiss(animated: true, completion: {
                         
-                        // Send file
-//                        CCNetworking.shared().uploadFile(metadata.fileNameView, serverUrl: serverUrl, assetLocalIdentifier: nil, path:self.appDelegate.directoryUser!, session: k_upload_session, taskStatus: Int(k_taskStatusResume), selector: nil, selectorPost: nil, errorCode: 0, delegate: self.appDelegate.activeMain)
+                        metadata.path = self.appDelegate.directoryUser!
+                        metadata.session = k_upload_session
+                        metadata.sessionSelector = selectorUploadFile
+                        metadata.status = Double(k_metadataStatusWaitUpload)
+
+                        _ = NCManageDatabase.sharedInstance.addMetadata(metadata)
+                        self.appDelegate.perform(#selector(self.appDelegate.loadAutoDownloadUpload), on: Thread.main, with: nil, waitUntilDone: true)
+
                         NotificationCenter.default.post(name: NSNotification.Name(rawValue: "detailBack"), object: nil)
                     })