Skip to content

fix(files): validate dropped filenames before upload - #63997

Merged
hamza221 merged 1 commit into
masterfrom
fix/validate-name-drag-and-drop
Sep 17, 2026
Merged

hamza221 merged 1 commit into
masterfrom
fix/validate-name-drag-and-drop

Conversation

@hamza221

@hamza221 hamza221 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

When uploading a file with a forbidden name test\ as an example it behaves differently depending on the upload method:

  • Drag and drop -> reaches DAV and you get no concise user facing error
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:o="http://owncloud.org/ns">
  <s:exception>OCA\DAV\Connector\Sabre\Exception\InvalidPath</s:exception>
  <s:message>"\" is not allowed inside a file or folder name.</s:message>
  <o:retry xmlns:o="o:">false</o:retry>
  <o:reason xmlns:o="o:">"\" is not allowed inside a file or folder name.</o:reason>
</d:error>

  • Through the upload button it gets renamed

For the sake of simplicity added a check before upload on drag and drop with error handling

TODO

  • ...

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI
    Assisted-by: Codex:gpt-5.6-sol

@hamza221 hamza221 self-assigned this Sep 3, 2026
@hamza221
hamza221 requested review from a team and skjnldsv as code owners September 3, 2026 11:54
@hamza221
hamza221 removed the request for review from a team September 3, 2026 11:54
@hamza221 hamza221 added the bug label Sep 3, 2026
@hamza221 hamza221 added 3. to review Waiting for reviews feature: files team: Files Code maintained by 📁 Files team labels Sep 3, 2026
@hamza221 hamza221 added this to the Nextcloud 36 milestone Sep 3, 2026
@hamza221

hamza221 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

/backport 53e8968 to stable35

@hamza221

hamza221 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

/backport 53e8968 to stable34

@hamza221

hamza221 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

/backport 53e8968 to stable33

@hamza221

This comment was marked as outdated.

@hamza221

hamza221 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

/compile

Comment thread apps/files/src/services/DropService.ts Outdated
@hamza221
hamza221 force-pushed the fix/validate-name-drag-and-drop branch from 297666e to ab49f0a Compare September 10, 2026 12:44
@hamza221
hamza221 requested a review from susnux September 10, 2026 12:45
Comment thread apps/files/src/services/DropServiceUtils.ts
Comment thread apps/files/src/services/DropService.ts
Comment thread apps/files/src/services/DropServiceUtils.ts

@pringelmann pringelmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good , just left a few comments around UX

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221
hamza221 force-pushed the fix/validate-name-drag-and-drop branch from ab49f0a to e4c4310 Compare September 17, 2026 19:33
@hamza221
hamza221 enabled auto-merge September 17, 2026 19:34
@hamza221
hamza221 merged commit 39ef490 into master Sep 17, 2026
85 of 86 checks passed
@hamza221

Copy link
Copy Markdown
Contributor Author

/backport to stable35

@hamza221

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@hamza221

Copy link
Copy Markdown
Contributor Author

/backport to stable33

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

Labels

3. to review Waiting for reviews AI assisted bug feature: files team: Files Code maintained by 📁 Files team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants