Skip to content
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

The Forms folder structure is not sanitized which can lead to synchronization issues when uploading files #2409

Open
stefan0xC opened this issue Nov 14, 2024 · 4 comments · May be fixed by #2513
Assignees
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working
Milestone

Comments

@stefan0xC
Copy link

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!

Describe the bug
Uploaded files are seemingly saved in a folder structure Forms/{id of form} - {title of form}/{id of submission}/{id of question} - {title of question} but the titles do not seem to get trimmed in regards to trailing white spaces, which results in syncing problems (at least on Windows 11 with NTFS).

To Reproduce
Steps to reproduce the behavior:

  1. Go to Forms and create a new form
  2. Call it test with a trailing whitespace
  3. Add a file upload option and call it test as well
  4. Upload a file

Expected behavior
I expect the fields that are used for filenames to be trimmed in regard to whitespace and maybe also sanitized regarding other invalid characters like :

Screenshots
If applicable, add screenshots to help explain your problem.
Image

Nextcloud (please complete the following information):

  • Nextcloud-Version: 30.0.2
  • Forms-Version: 4.3.3

Desktop (please complete the following information):

  • OS: Windows 11 with NTFS file system
  • Nexcloud Desktop v3.14.3
@stefan0xC stefan0xC added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Nov 14, 2024
@stefan0xC stefan0xC changed the title Uploading files to folders with trailing whitespace can cause issues with some file systems The Forms folder structure is not sanitized in regard to file names which lead to synchronization issues Nov 14, 2024
@stefan0xC stefan0xC changed the title The Forms folder structure is not sanitized in regard to file names which lead to synchronization issues The Forms folder structure is not sanitized which can lead to synchronization issues when uploading files Nov 14, 2024
@Chartman123 Chartman123 added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending approval or rejection. This issue is pending approval. labels Nov 14, 2024
@Chartman123 Chartman123 added this to the 4.3.4 milestone Nov 14, 2024
@Chartman123
Copy link
Collaborator

@Koc one more bug related to the file question type. I also had a similar issue with a : in the question title. So we should remove all offending characters from the folder names.

@Koc
Copy link
Collaborator

Koc commented Nov 19, 2024

I've tested it few scenarios:

  1. create form with trailing :
  2. create file question with trailing :
  3. upload file on Linux (devcontainer)

everything works fine
Image

  1. create form with trailing :
  2. create file question with trailing :
  3. upload file on Linux (devcontainer)

the same
Image

We're already using normalizeFileName which uses \OCP\Constants::FILENAME_INVALID_CHARS under the hood. And as far I can see from the constant description - we aren't supporting Windows.

@Chartman123
Copy link
Collaborator

@Koc yes that's right, at least server side. But the official sync client sure does support Windows. Perhaps we can have a look how Server/Files solves that problem?

@Chartman123 Chartman123 modified the milestones: 4.3.4, 4.3.5 Nov 25, 2024
@Chartman123 Chartman123 modified the milestones: 4.3.5, 4.3.6 Jan 14, 2025
@Koc
Copy link
Collaborator

Koc commented Jan 23, 2025

Finally I was able to reproduce this issue. Fix

@Chartman123 Chartman123 modified the milestones: 4.3.6, 4.3.7 Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants