fix(files): use destination path for MKCOL during drag & drop folder upload#58655
fix(files): use destination path for MKCOL during drag & drop folder upload#58655Le-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>
|
Hello @Le-Syl21, can you share before/after screencast of the issue? |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
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