|
@@ -431,6 +431,16 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
|
|
|
|
|
|
var listData: [String] = []
|
|
|
|
|
|
+ // Detect metadataKeyedUnarchiver
|
|
|
+ var foundMetadataKeyedUnarchiver: Bool = false
|
|
|
+ for item in UIPasteboard.general.items {
|
|
|
+ for object in item {
|
|
|
+ if object.key == NCBrandGlobal.shared.metadataKeyedUnarchiver {
|
|
|
+ foundMetadataKeyedUnarchiver = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
for item in UIPasteboard.general.items {
|
|
|
for object in item {
|
|
|
let contentType = object.key
|
|
@@ -445,16 +455,18 @@ class NCCollectionCommon: NSObject, NCSelectDelegate {
|
|
|
}
|
|
|
continue
|
|
|
}
|
|
|
- if data is String {
|
|
|
- if listData.contains(data as! String) {
|
|
|
- continue
|
|
|
- } else {
|
|
|
- listData.append(data as! String)
|
|
|
+ if !foundMetadataKeyedUnarchiver {
|
|
|
+ if data is String {
|
|
|
+ if listData.contains(data as! String) {
|
|
|
+ continue
|
|
|
+ } else {
|
|
|
+ listData.append(data as! String)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let type = NCCommunicationCommon.shared.convertUTItoResultType(fileUTI: contentType as CFString)
|
|
|
+ if type.resultTypeFile != NCCommunicationCommon.typeFile.unknow.rawValue && type.resultExtension != "" {
|
|
|
+ uploadPasteFile(fileName: type.resultFilename, ext: type.resultExtension, contentType: contentType, serverUrl: serverUrl, data: data)
|
|
|
}
|
|
|
- }
|
|
|
- let type = NCCommunicationCommon.shared.convertUTItoResultType(fileUTI: contentType as CFString)
|
|
|
- if type.resultTypeFile != NCCommunicationCommon.typeFile.unknow.rawValue && type.resultExtension != "" {
|
|
|
- uploadPasteFile(fileName: type.resultFilename, ext: type.resultExtension, contentType: contentType, serverUrl: serverUrl, data: data)
|
|
|
}
|
|
|
}
|
|
|
}
|