I need to send a file to the server. I select this file with UIViewControllerRepresentable which provides the url of the file and every time I try to upload I get the same message :- Domain=NSCocoaErrorDomain Code=257 "The file “example1.xml” couldn’t be opened because you don’t have permission to view it." . I think I need to add permissions on info.plist but I don't find the right one. If I select a file in the sandbox it works.
how can I read a file out of sandbox? (swift 5 , xcode 12)
814 Views Asked by Vic At
1
There are 1 best solutions below
Related Questions in SWIFT5
- How to do a Tuple extension in current Swift? It seems to be available experimentally
- No such module 'SwiftData'
- Is it perfectly correct that this computed property will work like a "pointer" in current Swift?
- Combining drawing animation with live video using Swift and Pencilkit
- Is it absolutely the case that Swift >will not< deep copy a large array, when one "guard let" the array?
- Is there a way to drop the comma and space elements when using Date.FormatStyle?
- NavigationStackView .searchable modifier not visible when embedded in NavigationSplitView
- Get height of a view inside ZStack in SwiftUI
- How to add axis titles with DGCharts in Swift?
- swift | Nothing in multiple TableView with custom cell
- Xcode 15: After deploy build to TestFlight, fonts have another style
- xcode datatask not running
- How can I change the source location of an OSLog Message?
- QLPreviewControllerRepresentation does not conform to protocol UIViewControllerRepresentable
- NSBatchInsert does not work for CoreData Transformable Attribute e.g. Dictionary<String, String>
Related Questions in SANDBOX
- How do I separate emails (from 1 alias) in Thunderbird from invasive websites on Firefox with file browsing scripts? Should I worry?
- what's meaning, process is not in an inherited sandbox, when i run my helper app within a electron build app
- Resetting NetSuite Sandbox to Default Without Production Data
- simulate paypal payments with sandbox credit cards generator
- Pdf is not loading on mobile broswer
- How to use xdg-open in bwrap environment to open dir in the unsandboxed filesystem
- Upgraded Azure Data Explorer to python sandbox image 3.10 - impossible to install (extract) external packages
- Azure app authentication with Sandbox account returns "unauthorized_client: The client does not exist or is not enabled for consumers." error
- No handlers could be found for logger "cuckoo"
- Swift Vapor Console App - The operation couldn’t be completed. Permission denied
- How to prevent external script from top level navigation
- Amazon SPAPI error "could match input arguments"
- snakemake has issue with using singularity
- Will the privacy sandbox have an impact on xmlhttprequest requests and will there be a problem with authentication?
- PayPal payment showing as pending in hotel booking lite plugin on localhost
Related Questions in IOS14
- Create custom interactive tooltip in swiftUI
- Is it possible to disable the back navigation menu in SwiftUI?
- Set UITableViewCell secondaryText multiple lines
- Orientation issue occurs While Rotate landscape mode to portrait mode In SwiftUI
- Get height of a view inside ZStack in SwiftUI
- How to add Done button to Number Pad keyboard in swiftUI iOS 14
- Resolve: background(alignment:content:) is only available in iOS 15.0 or newer
- How to add axis titles with DGCharts in Swift?
- SwiftUI Interation with Widget on iOS 14
- Is there a way that I can use to create a Dynamic Sheet Height using in SwiftUI (iOS14.7)?
- conflicts with navigation view on SwiftUI
- iOS 13 ObservedObject is not updating the UI while StateObject doing same in iOS 14
- Issue with Combine when migrating to iOS 14
- iOS Universal Linking with Browsers other than Safari
- I can not debug ionic app on macOS ventura. What has changed?
Related Questions in INFO.PLIST
- iOS Simulator Debug: Launching 'tel' and 'mailto' Schemes Results in Errors
- Deep links in AppleWatch
- Cannot change default Permission String of Expo Plugins (Camera etc.)
- How to use info.plist in Xcode UITest target?
- How to hide a specific active app on OS Sonama (Version 14.1.1)
- Is there a way to code format info.plist file like prettier?
- How to add a value dynamically in Info.Plist file
- How to install Xcode 15.2 on macOS Monterey 12.7.3
- Missing required icon file & Info.plist value error in Xcode
- Asset validation Error while validating app in Xcode (Missing info.plist value etc.)
- Flutter NFC: "The connection to service named com.apple.nfcd.service.corenfc was invalidated from this process"
- Flutter IOS camera permission not working for permission_handler package
- Are Branch.io Test and Live keys considered secrets?
- App rejected Guideline 2.5.4 - Performance - Software Requirements
- The LSUIElement key in Info.plist is being ignored (AvaloniaUI, net7.0-macos)
Related Questions in SECURITY-SCOPED-BOOKMARKS
- When to use stopAccessingSecurityScopedResource in SwiftUI macOS app
- C library fopen fails
- Mac OS App Sandbox - Can't Write File Without NSOpenPanel or NSSavePanel
- How to save security scoped URL for later use macOS
- How to use iOS security scoped bookmarks across devices?
- Read files from Pasteboard file-url inside macOS sandbox
- Can't access contents of a Security-Scoped directory URL
- Retrieve permission for a file from the command line
- Xamarin.Mac Using security-scoped bookmarks
- how can I read a file out of sandbox? (swift 5 , xcode 12)
- ReferenceFileDocument and Document-scoped bookmarks
- MacOS internal sandbox error for <StopAccessing>
- Accessing iCloud file on multiple devices via security-scoped bookmark
- SwiftySandboxFileAccess UserDefaults value
- macOS Security scoped URL bookmark for folder
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I solved it by using .startAccessingSecurityScopedResource () on the URL. Eg:
`var path = URL (string: "pathFile")!
//before reading the file
path.startAccessingSecurityScopedResource ()
//at the end
path.stopAccessingSecurityScopedResource ()
//to close. `
resources https://developer.apple.com/documentation/foundation/nsurl/1417051-startaccessingsecurityscopedreso