Skip to content

Folder creation on server allows trailing whitespaces, breaks upload #17547

Description

@mga0

⚠️ Before posting ⚠️

  • This is a bug, not a question or an enhancement.
  • I've searched for similar issues and didn't find a duplicate.
  • I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
  • I agree to follow Nextcloud's Code of Conduct.

Steps to reproduce

In the app, folder creation on server allows trailing whitespaces. This breaks following the upload of files to nextcloud server side.

How to reproduce:

  1. In some user's server space, press "(+)" -> " New folder" -> Type a folder with a trailing whitespace (e.g "Test ")
  2. Folder is created successfully with whitespace
  3. Add some files to it
  4. See the upload breaking with upload error "Unknown Error"
  5. Check server's log, (below)

Expected behaviour

As some keywords have auto-completion with auto whitespace insertion, the folder name should be sanitized in the app before being sent to the server for folder creation.
Following, the upload will go through.

Actual behaviour

The upload breaks after some time in the upload section with error "Unknown Error"
Check server's log, (below)

Android version

14

Device brand and model

Pixel 5

Stock or custom OS?

Stock

Nextcloud android app version

34.1.1

Nextcloud server version

33.0.2

Using a reverse proxy?

Yes

Android logs

No response

Server error logs

Warning | PHP | file_put_contents(/data/myuser/files/Test /fdb98d809cd16c30d0ad66042794cf9b.ocTransferId922929805.part): Failed to open stream: Not a directory at /var/www/html/lib/private/Files/Storage/Local.php#306

Error | webdav | GenericFileExceptionFailed write stream to files/Test /fdb98d809cd16c30d0ad66042794cf9b.ocTransferId922929805.part
Error while writing stream to storage: Failed write stream to files/Test /fdb98d809cd16c30d0ad66042794cf9b.ocTransferId922929805.part

Error | no app in context | ExceptionError while copying file to target location (copied: -1 bytes, expected filesize: 2882130 bytes)

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions