Skip to content

fix(files): use destination path for MKCOL during drag & drop folder upload#58655

Open
Le-Syl21 wants to merge 1 commit intonextcloud:masterfrom
Le-Syl21:fix/drag-drop-mkcol-destination-path
Open

fix(files): use destination path for MKCOL during drag & drop folder upload#58655
Le-Syl21 wants to merge 1 commit intonextcloud:masterfrom
Le-Syl21:fix/drag-drop-mkcol-destination-path

Conversation

@Le-Syl21
Copy link

@Le-Syl21 Le-Syl21 commented Mar 1, 2026

Summary

  • Fix drag & drop folder upload: 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_copy into cmdb/:

  1. createDirectoryIfNotExists('/folder_to_copy') checked if /files/user/folder_to_copy existed (the source folder)
  2. It returned true → MKCOL was skipped
  3. uploader.upload() correctly targeted /files/user/cmdb/folder_to_copy/file.txt via destination.source
  4. 404 Not Found because /cmdb/folder_to_copy/ was never created

The fix prepends destination.path so the existence check and MKCOL target the correct path: /cmdb/folder_to_copy.

Related issues

Test plan

  • Drag & drop a single folder with files into another folder → structure preserved
  • Drag & drop nested folders (folder with subfolders) → all levels created
  • Drag & drop a folder that already exists at destination → conflict handling works
  • Drag & drop multiple folders simultaneously → all created
  • Drag & drop to root level → works
  • Drag & drop to a deeply nested destination → works
  • Import button (file input) still works as before

🤖 Generated with Claude Code

…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>
@Le-Syl21 Le-Syl21 requested review from a team and skjnldsv as code owners March 1, 2026 22:49
@Le-Syl21 Le-Syl21 requested review from artonge and sorbaugh and removed request for a team March 1, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant