-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XLSX File is not Read from documentPicker #162
Comments
Could you also share more details about this behavior? What do you mean by "file is not read"? Is an error thrown in the code that you're catching? Does it trigger any of the |
it triggers fatalError before I added startAccessingSecurityScopedResource |
In your code from the description, you're assigning a path URL passed by the document picker as |
Originally this is what I did let url = urls[0]
let filePath = url.path
guard url.startAccessingSecurityScopedResource() else {
print("failed accessing security scope")
return
}
defer { url.stopAccessingSecurityScopedResource() }
guard let file = XLSXFile(filepath: filePath) else {
fatalError("XLSX file at \(filePath) is corrupted or does not exist")
} However it did not work so the next thing I tried was copy it to NSSearchPathForDirectoriesInDomains The aim of the code is to pick an excel file from the document picker and read it but I had no luck in getting it to work |
And in this original code, which exact line was bailing out, |
|
Have you tried following this SO page? https://stackoverflow.com/questions/41144992/startaccessingsecurityscopedresource-return-always-false According to it, |
Hi @tburnt, is this issue still reproducible for you? |
Version 0.14.1
Description of the bug
using documentPicker I tried opening an xlsx file however it does not open and it crashes to excel file is corrupted, I tried the solution from #160 but it did not work, I also tried to copy the file first to the bundle but it still does the same, also I tried to use fileExists originally with the url and filepath variable but still the same result
Steps to reproduce
Expected behavior
code should read the xlsx file
The text was updated successfully, but these errors were encountered: