nextcloud / nextcloud/android

Avoid using escaped special characters in local storage paths to improve compatibility with other apps

Open
#5,371 7 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted hotspot: device storage
Dominant language
Kotlin
Stars
5.6k
Forks
2k
Avg merge
2d 18h
Merged PRs (30d)
92

Description

### Is your feature request related to a problem? Please describe.
Newer NextCloud client allows selecting a storage path, but NextCloud creates another folder underneath that path.

Regardless of which one you select
1. /storage/emulated/0/Android/media/com.nextcloud.client
2. /data/user/0/Android/media/com.nextcloud.client
3. /storage/emulated/0/Android/data/com.nextcloud.client

NextCloud will create another few subdirectories in this structure

/nextcloud/@/somefile.txt

The problem is when the or has special characters.

In my case, I can't host on port 80, and I'm using a subpath to host.

user = "testuser"
server = "example.com:8888/nextcloud/"

So the combined path that the NextCloud client uses to store this file is

/storage/emulated/0/Android/media/com.nextcloud.client/**testuser@example.com%3A8888%2Fnextcloud**/somefile.txt

This causes many issues with other apps that try to read this file. VLC for one can read an audio file once but never read it again. While I can file a bug with them, attaching an image with LINE for example, while LINE sees the image, attaching it will fail. I can list off apps which have problems with it, but long story short is, there's quite a few that I encounter here and there.

### Describe the solution you'd like
Preferably keep the path simple, with no special escaped characters. If NextCloud is trying to have a unique path for any servers you connect to, perhaps just store that somewhere in the database that server A points to path A.

Or hash the user+server and use that instead.

Any path is good as long as it doesn't have URLencoded escape sequences.

### Describe alternatives you've considered
I have considered submitting bugs individually to apps that don't work with this special path, but it seems like the path with port number and an escaped '/' causes enough apps to fail that it might be better to fix the client instead.

I've also tried searching on the help forums and other github issues and have not seen anything reported which is similar.

### Additional context
(I can provide additional shots of apps not working, but I feel like that is moot.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.