A selected directory has the identity of a file
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Steps to reproduce
- Write an app which lets the user pick a folder by using UIDocumentPickerViewController
- Connect the iOS Nextcloud app to a Nextcloud instance and make sure there is at least one folder in it.
- Run your test app and pick a folder on the Nextcloud (file provider)
- check if the picked item is a directory (by using FileManager.default.fileExists(atPath: pickedURL.path(percentEncoded: false), isDirectory: &isDirectory))
Expected behaviour
isDirectory.boolValue must be true
Actual behaviour
isDirectory.boolValue is false and it looks like it is a file containing data. The content of the file is a string: "This is the WebDAV interface. It can only be accessed by WebDAV clients such as the Nextcloud desktop sync client."
po String(data: try! Data(contentsOf: pickedURL), encoding: .utf8) ▿ Optional<String>
- some : "This is the WebDAV interface. It can only be accessed by WebDAV clients such as the Nextcloud desktop sync client."
Reasoning or why should it be changed/implemented?
This looks like a bug
Environment data
iOS version: e.g. iOS 17.6.1 iPadOS 18.2.1 (22C164)
Nextcloud iOS app version: see More > Settings 6.2.4 (2) / latest version from Testflight at this time
Server operating system:
Web server: Apache, nginx
Database:
PHP version:
Nextcloud version: see Nextcloud admin page 30.0.5
Hiya folks. My app users reported being unable to use Nexcloud-provided directories.
My app also uses UIDocumentPickerViewController to pick directories and copying a file to the picked directory using FileManager.default.copyItem fails with:
{Error Domain=NSPOSIXErrorDomain Code=20 "Not a directory"}
I am an affected user. Happy to help testing.
I am an affected user too. Multiple apps have this issue making nextcloud unusable via apps. Even Apples shortcuts apps can’t write to files within Nextcloud.