marinofaggiana пре 4 година
родитељ
комит
75f43340d2
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      iOSClient/Main/Colleaction Common/NCCollectionCommon.swift

+ 2 - 1
iOSClient/Main/Colleaction Common/NCCollectionCommon.swift

@@ -433,12 +433,13 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
     }
 
     private func uploadPasteFile(fileName: String, ext: String, contentType: String, serverUrl: String, data: Data) {
+        
         do {
             let fileNameView = fileName + "_" + CCUtility.getIncrementalNumber() + "." + ext
             let ocId = UUID().uuidString
             let filePath = CCUtility.getDirectoryProviderStorageOcId(ocId, fileNameView: fileNameView)!
             
-            try (data as? Data)?.write(to: URL(fileURLWithPath: filePath))
+            try data.write(to: URL(fileURLWithPath: filePath))
            
             let metadataForUpload = NCManageDatabase.shared.createMetadata(account: appDelegate.account, fileName: fileNameView, ocId: ocId, serverUrl: serverUrl, urlBase: appDelegate.urlBase, url: "", contentType: contentType, livePhoto: false)