Document picker pdf file upload to server working in simulator but not working on real device iOS swift
Solution: Because it had security issues for accessing the storage in real device.So follow the below code to copy the data or file to the document directory or your local variable after that upload it to the server.Then no issue will be appear. startAccessingSecurityScop edResource must be called for storage access func documentPicker ( _ controller: UIDocumentPickerViewController , didPickDocumentsAt urls: [ URL ]) { guard controller. documentPickerMode == . open , let url = urls. first , url. startAccessingSecurityScop edResource () else { return } defer { DispatchQueue. main . async { url. stopAccessingSecurityScope dResource () ...