fix(files): use destination path for MKCOL during drag & drop folder upload#58655
Open
Le-Syl21 wants to merge 1 commit intonextcloud:masterfrom
Open
fix(files): use destination path for MKCOL during drag & drop folder upload#58655Le-Syl21 wants to merge 1 commit intonextcloud:masterfrom
Le-Syl21 wants to merge 1 commit intonextcloud:masterfrom
Conversation
…upload createDirectoryIfNotExists was called with a path relative to the user's DAV root instead of the destination folder. When dragging folder_to_copy into cmdb/, it checked if /folder_to_copy existed (the source — yes) instead of /cmdb/folder_to_copy (the destination — no), skipping the MKCOL entirely and causing a 404 on the subsequent PUT. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createDirectoryIfNotExists()was called with a path relative to the user's DAV root instead of the destination folder, causing the MKCOL to be skipped entirely and the subsequent PUT to fail with a 404.Root cause
When dragging
folder_to_copyintocmdb/:createDirectoryIfNotExists('/folder_to_copy')checked if/files/user/folder_to_copyexisted (the source folder)true→ MKCOL was skippeduploader.upload()correctly targeted/files/user/cmdb/folder_to_copy/file.txtviadestination.source/cmdb/folder_to_copy/was never createdThe fix prepends
destination.pathso the existence check and MKCOL target the correct path:/cmdb/folder_to_copy.Related issues
Test plan
🤖 Generated with Claude Code