Post

Replies

Boosts

Views

Activity

Reply to Drop file not found on MacBook Air
Ok. I tried my user directory and the user directory. Same result: ❌ Échec lors de la copie : Error Domain=NSCocoaErrorDomain Code=4 "Le fichier « 2019-BMW-X2-Specs-Build-Sheet.pdf » n’existe pas." UserInfo={NSSourceFilePathErrorKey=/.nofollow/Users/2019-BMW-X2-Specs-Build-Sheet.pdf, NSUserStringVariant=(     Copy ), NSDestinationFilePath=/Users/jean-philippegreaux/Library/Containers/jgreaux.gestion-de-comptes/Data/Documents/2025/7/justificatif_88.pdf, NSFilePath=/.nofollow/Users/2019-BMW-X2-Specs-Build-Sheet.pdf, NSURL=file:///.nofollow/Users/2019-BMW-X2-Specs-Build-Sheet.pdf, NSUnderlyingError=0x600001ed9410 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} ❌ Échec lors de la copie : Error Domain=NSCocoaErrorDomain Code=4 "Le fichier « 2019-BMW-X2-Specs-Build-Sheet.pdf » n’existe pas." UserInfo={NSSourceFilePathErrorKey=/Users/jean-philippegreaux/2019-BMW-X2-Specs-Build-Sheet.pdf, NSUserStringVariant=(     Copy ), NSDestinationFilePath=/Users/jean-philippegreaux/Library/Containers/jgreaux.gestion-de-comptes/Data/Documents/2025/7/justificatif_87.pdf, NSFilePath=/Users/jean-philippegreaux/2019-BMW-X2-Specs-Build-Sheet.pdf, NSURL=file:///Users/jean-philippegreaux/2019-BMW-X2-Specs-Build-Sheet.pdf, NSUnderlyingError=0x600001ecb4e0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} The drag and drop is on a swiftUI component VStack().onDrop() which is displayed in a .sheet() Here is the function used in .onDrop() func handleJustificatif( providers: [NSItemProvider], currentTransaction: Transaction, completion: @escaping (Bool) -> Void ) { guard let provider = providers.first, provider.hasItemConformingToTypeIdentifier(UTType.fileURL.identifier) else { print("❌ Aucun provider ou fichier PDF détecté") completion(false) return } provider.loadItem(forTypeIdentifier: UTType.fileURL.identifier, options: nil) { item, error in guard let data = item as? Data, let fileURL = URL(dataRepresentation: data, relativeTo: nil) else { print("❌ Impossible d'extraire l'URL depuis l'item") completion(false) return } let accessGranted = fileURL.startAccessingSecurityScopedResource() defer { if accessGranted { fileURL.stopAccessingSecurityScopedResource() } } do { let tempData = try Data(contentsOf: fileURL) let prefix = tempData.prefix(4) guard let prefixString = String(data: prefix, encoding: .ascii), prefixString.hasPrefix("%PDF") else { print("❌ Fichier non valide : taille \(tempData.count) — préfixe : \(prefix)") completion(false) return } print("✅ PDF détecté") let relativePath = currentTransaction.getAttachmentPath() let documentsURL = try FileManager.default.url( for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true ) let destinationURL = documentsURL.appendingPathComponent(relativePath) if FileManager.default.fileExists(atPath: destinationURL.path) { try FileManager.default.removeItem(at: destinationURL) } try FileManager.default.copyItem(at: fileURL, to: destinationURL) DispatchQueue.main.async { currentTransaction.attachment = tempData.count print("✅ PDF copié : \(destinationURL.lastPathComponent) (\(tempData.count) octets)") completion(true) } } catch { print("❌ Échec lors de la copie : \(error)") completion(false) } } Hope that help, Thanks again
Topic: App & System Services SubTopic: Core OS Tags:
Aug ’25
Reply to Drop file not found on MacBook Air
The error persists in the document folder and on the desktop. Here are the logs when droping from the document folder: Unable to open mach-O at path: default.metallib  Error:2 ✅ PDF détecté ❌ Échec lors de la copie : Error Domain=NSCocoaErrorDomain Code=4 "Le fichier « Facture - Contrôle Technique - Land Rover Defender - 118V.pdf » n’existe pas." UserInfo={NSSourceFilePathErrorKey=/Users/jean-philippegreaux/Documents/Facture - Contrôle Technique - Land Rover Defender - 118V.pdf, NSUserStringVariant=(     Copy ), NSDestinationFilePath=/Users/jean-philippegreaux/Library/Containers/jgreaux.gestion-de-comptes/Data/Documents/2025/7/justificatif_89.pdf, NSFilePath=/Users/jean-philippegreaux/Documents/Facture - Contrôle Technique - Land Rover Defender - 118V.pdf, NSURL=file:///Users/jean-philippegreaux/Documents/Facture%20-%20Contro%CC%82le%20Technique%20-%20Land%20Rover%20Defender%20-%20118V.pdf, NSUnderlyingError=0x600001a37ed0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} ❌ Échec du traitement du fichier 5 Reentrant message: kDragIPCCompleted, current message: kDragIPCLeaveApplication I even try to change the file name to avoid special characters and nothing change. Hope you have other ideas. Thanks
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’25
Reply to Drop file not found on MacBook Air
Tanks for the answer, The Logs from Xcode (on the Mac Book Air) are the following: 5 Reentrant message: kDragIPCWithinWindow, current message: kDragIPCWithinWindow ✅ PDF détecté ❌ Échec lors de la copie : Error Domain=NSCocoaErrorDomain Code=4 "Le fichier « brochure_nissan_eNV200_evalia-2.pdf » n’existe pas." UserInfo={NSSourceFilePathErrorKey=/Users/jean-philippegreaux/Downloads/brochure_nissan_eNV200_evalia-2.pdf, NSUserStringVariant=(     Copy ), NSDestinationFilePath=/Users/jean-philippegreaux/Library/Containers/jgreaux.gestion-de-comptes/Data/Documents/2025/7/justificatif_80.pdf, NSFilePath=/Users/jean-philippegreaux/Downloads/brochure_nissan_eNV200_evalia-2.pdf, NSURL=file:///Users/jean-philippegreaux/Downloads/brochure_nissan_eNV200_evalia-2.pdf, NSUnderlyingError=0x600002a8ab80 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} ❌ Échec du traitement du fichier 5 Reentrant message: kDragIPCCompleted, current message: kDragIPCLeaveApplication ps: what's bothering me is that the issues is none existant on my MacMini Thanks in advance
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’25