Browse Source

fix Rename

Marino Faggiana 6 years ago
parent
commit
7fe514b9ca
1 changed files with 4 additions and 1 deletions
  1. 4 1
      PickerFileProvider/FileProvider.swift

+ 4 - 1
PickerFileProvider/FileProvider.swift

@@ -746,7 +746,10 @@ class FileProvider: NSFileProviderExtension, CCNetworkingDelegate {
 
             } else {
                 
-                NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, date: nil, exifDate: nil, exifLatitude: nil, exifLongitude: nil, fileName: itemName, etag: nil, etagFPE: nil)
+                do {
+                    try FileManager.default.moveItem(atPath: fileProviderStorageURL!.path + "/" + metadata.fileID + "/" + item.filename, toPath: fileProviderStorageURL!.path + "/" + metadata.fileID + "/" + itemName)
+                    NCManageDatabase.sharedInstance.setLocalFile(fileID: metadata.fileID, date: nil, exifDate: nil, exifLatitude: nil, exifLongitude: nil, fileName: itemName, etag: nil, etagFPE: nil)
+                } catch { }
             }
             
             completionHandler(item, nil)