Skip to content

Conversation

@skjnldsv
Copy link
Member

@skjnldsv skjnldsv commented May 13, 2025

Fix #15921

Explanations

Because we cannot give read permissions on a file drop, uploading subfolders is not possible.
Each parent will throw thus preventing to create nested paths. This allowed us to NOT touch the way the normal webdav works and keep things clean.

To circumvent this, we hijack the method in the fileDrop plugin.

  1. We always return 201 when doing a MKCOL, thus faking any path being created
  2. This allow the uploader to believe the path leading to a file exists
  3. Then it allows us to create said path before handling the conflicts as we used to do.

Details

  • We do not handle folders conflicts. If a folder already exists, uploading files will merge folders together
  • We force the declaration of a Nickname header if you wanna upload folders. This is to make the file tree clean and help share owners knowing who uploaded a file

Secondary

Also includes the removal of a piece of code that was creating issues in the plugin bootstrapping: aa41532
The getHTTPMethods is only here to declare new methods that aren't already handled by the dav server. It is not to conditionally enable or disable a plugin.
https://github.com/nextcloud/3rdparty/blob/1a2d791504fcbbe4758e721877c640cd55a7199b/sabre/dav/lib/DAV/Server.php#L506-L530

@skjnldsv skjnldsv added this to the Nextcloud 32 milestone May 13, 2025
@skjnldsv skjnldsv self-assigned this May 13, 2025
@skjnldsv skjnldsv requested a review from a team as a code owner May 13, 2025 10:01
@skjnldsv skjnldsv requested review from artonge, come-nc and provokateurin and removed request for a team May 13, 2025 10:01
@skjnldsv skjnldsv force-pushed the feat/file-drop-recursive branch from c4d99cf to 264ee75 Compare May 13, 2025 10:25
@skjnldsv skjnldsv requested a review from Altahrim May 13, 2025 10:25
provokateurin

This comment was marked as resolved.

@skjnldsv

This comment was marked as resolved.

@skjnldsv skjnldsv force-pushed the feat/file-drop-recursive branch from 264ee75 to edf757f Compare May 13, 2025 12:17
@skjnldsv skjnldsv requested a review from susnux May 13, 2025 12:25
@skjnldsv skjnldsv force-pushed the feat/file-drop-recursive branch 2 times, most recently from 00dbedc to aa41532 Compare May 13, 2025 12:28
@skjnldsv skjnldsv requested a review from provokateurin May 13, 2025 12:29
Copy link
Contributor

@susnux susnux left a comment

Choose a reason for hiding this comment

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

🚀 Only found some casing things

@skjnldsv skjnldsv force-pushed the feat/file-drop-recursive branch 2 times, most recently from fb99a5f to 221d0db Compare May 13, 2025 12:42
@skjnldsv skjnldsv force-pushed the feat/file-drop-recursive branch from 221d0db to 5ddcd85 Compare May 13, 2025 13:51
skjnldsv added 2 commits May 13, 2025 16:03
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
@skjnldsv skjnldsv force-pushed the feat/file-drop-recursive branch from 5ddcd85 to b286bca Compare May 13, 2025 14:03
@skjnldsv skjnldsv merged commit b9da941 into master May 13, 2025
206 of 224 checks passed
@skjnldsv skjnldsv deleted the feat/file-drop-recursive branch May 13, 2025 16:27
@skjnldsv skjnldsv mentioned this pull request Aug 19, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow uploading folders on file-drop ("upload only") shares

4 participants