android
android copied to clipboard
Files with special characters in their filename cannot be downloaded
Actual behaviour
Trying to download many of my files (presumably those containing some special char, e.g. ":") results in an error.
Expected behaviour
All files with valid filenames on the server should be downloadable. If the app cannot deal with some chars, they should be encoded.
Steps to reproduce
- in web UI, rename "welcome.txt" to "welcome:1.txt"
- in android app, search "welcome:1.txt", select "download"
- see error
Environment data
Android version: 6.0 Device model: LG4 Stock or customized system: Stock Nextcloud app version: 3.3.0 Nextcloud server version: 14.0.3
GitMate.io thinks possibly related issues are https://github.com/nextcloud/android/issues/1579 (Can't download files), https://github.com/nextcloud/android/issues/684 (Files containing "?" in their filename are not downloaded by the client), https://github.com/nextcloud/android/issues/685 (Directories containing ":" in their filename are not downloaded (synced) by the client), https://github.com/nextcloud/android/issues/764 (Android can not download any file), and https://github.com/nextcloud/android/issues/347 (Unable to download files).
Is your storage configured to use internal or external/sdcard storage? As far as I know there is / was on older devices fat used on sdcard, which does not allow these characters.
Tried it on two devices, both configured to use external storage (not sure which filesystem type and how to find that out). Also found https://github.com/nextcloud/android/issues/685, so it might well be a duplicate of that. It would still be nice to have a workaround, as (for example) the subsonic app works perfectly well with identical settings on both devices (saves files to ext storage for offline playback).
This request did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!
I have the same issue syncing a folder containing the following files (one filename per line, single quotes not part of the file name):
'Disc 1 - 01 - "La Sonata del Diavolo" in G minor, B. g5: [Largo].ogg'
'Disc 1 - 02 - "La Sonata del Diavolo" in G minor, B. g5: Allegro.ogg'
'Disc 1 - 03 - "La Sonata del Diavolo" in G minor, B. g5: Andante - Allegro - Adagio.ogg'
'Disc 1 - 04 - From "L'\''arte del arco" (Fourteen Variations on the Gavotte from op. 5 no. 10 by Corelli), B. F11: Theme and Variation 1.ogg'
'Disc 1 - 05 - From "L'\''arte del arco" (Fourteen Variations on the Gavotte from op. 5 no. 10 by Corelli), B. F11: Variations 2 & 4.ogg'
'Disc 1 - 06 - From "L'\''arte del arco" (Fourteen Variations on the Gavotte from op. 5 no. 10 by Corelli), B. F11: Variations 9, 15, & 12.ogg'
'Disc 1 - 07 - From "L'\''arte del arco" (Fourteen Variations on the Gavotte from op. 5 no. 10 by Corelli), B. F11: Variations 10 & 20.ogg'
'Disc 1 - 08 - From "L'\''arte del arco" (Fourteen variations on the Gavotte from op. 5 no. 10 by Corelli), B. F11: Variation 29.ogg'
'Disc 1 - 09 - From "L'\''arte del arco" (Fourteen Variations on the Gavotte from op. 5 no. 10 by Corelli), B. F11: Variation 30.ogg'
'Disc 1 - 10 - From "L'\''arte del arco" (Fourteen Variations on the Gavotte from op. 5 no. 10 by Corelli), B. F11: Variation 33.ogg'
'Disc 1 - 11 - From "L'\''arte del arco" (Fourteen Variations on the Gavotte from op. 5 no. 10 by Corelli), B. F11: Variation 34.ogg'
'Disc 1 - 12 - From "L'\''arte del arco" (Fourteen Variations on the Gavotte from op. 5 no. 10 by Corelli), B. F11: Variation 23.ogg'
'Disc 1 - 13 - From "L'\''arte del arco" (Fourteen Variations on the Gavotte from op. 5 no. 10 by Corelli), B. F11: Variation 38.ogg'
'Disc 1 - 14 - Sonata in A minor, B. a3: Cantabile.ogg'
'Disc 1 - 15 - Sonata in A minor, B. a3: Allegro.ogg'
'Disc 1 - 16 - Sonata in A minor, B. a3: [Andante].ogg'
'Disc 1 - 17 - Sonata in A minor, B. a3: Giga.ogg'
'Disc 1 - 18 - Sonata in A minor, B. a3: Aria (with variations).ogg'
'Disc 1 - 19 - Sonata in A minor, B. a3: Variation I.ogg'
'Disc 1 - 20 - Sonata in A minor, B. a3: Variation II.ogg'
'Disc 1 - 21 - Sonata in A minor, B. a3: Variation III.ogg'
'Disc 1 - 22 - Sonata in A minor, B. a3: Variation IV.ogg'
'Disc 1 - 23 - Sonata in A minor, B. a3: Variation V.ogg'
'Disc 1 - 24 - "Pastorale" for violin in scordature, B. A16: Grave.ogg'
'Disc 1 - 25 - "Pastorale" for violin in scordature, B. A16: Allegro.ogg'
'Disc 1 - 26 - "Pastorale" for violin in scordature, B. A16: Largo - Presto - Andante.ogg'
("same issue" = "when I try to sync the folder on my Android phone, I get 26 notifications about Download failed: Could not download $FILENAME.ogg)
I renamed the files to 01.ogg, 02.ogg, etc. and the folder synced successfully.
This is on server version 24.0.3 (managed by Hetzner) and Android app version 3.21.0 (installed via F-Droid).
Seeing this too, I think the issue is new since upgrading to nextcloud 24, but I also switched from the docker container to my distro's package, so I can't say for sure. It appears to be on the app side, the server logs show a clear OK:
87.249.133.114 - tlater [23/Oct/2022:23:47:24 +0100] "GET /remote.php/dav/files/tlater//stuff/2022-10-23T15%3A51%3A58.png HTTP/1.1" 200 2539659 "-" "Mozilla/5.0 (Android) Nextcloud-android/3.21.2"
Is there anything I can do on the app side to see debug logs, or any kind of clearer reason than "download failed"?
Confirmed. Here's a trace:
2022-11-23 14:59:44.540 20101-20183 DownloadFi...eOperation com.nextcloud.client E Download of /Talk/welcome:1.md to /storage/emulated/0/Android/media/com.nextcloud.client/nextcloud/tmp/[email protected]/Talk/welcome:1.md: Unrecovered transport exception
java.io.IOException: Operation not permitted
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:317)
at java.io.File.createNewFile(File.java:1006)
at com.owncloud.android.lib.resources.files.DownloadFileRemoteOperation.downloadFile(DownloadFileRemoteOperation.java:113)
at com.owncloud.android.lib.resources.files.DownloadFileRemoteOperation.run(DownloadFileRemoteOperation.java:88)
at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:205)
at com.owncloud.android.operations.DownloadFileOperation.run(DownloadFileOperation.java:180)
at com.owncloud.android.lib.common.operations.RemoteOperation.execute(RemoteOperation.java:205)
at com.owncloud.android.files.services.FileDownloader.downloadFile(FileDownloader.java:474)
at com.owncloud.android.files.services.FileDownloader.access$400(FileDownloader.java:88)
at com.owncloud.android.files.services.FileDownloader$ServiceHandler.handleMessage(FileDownloader.java:424)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.os.HandlerThread.run(HandlerThread.java:67)
As expected this is a limitation of the underlying filesystem, more research needed
Related: #685 #2711
While not encoding, the error message handling was improved in #11384
Duplicate of #8523 Fixed by #11384