nextcloud / nextcloud/server

Move file after chunked upload instead of copying

Open
#59,458 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage enhancement feature: dav hotspot: file transfer performance
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

[!TIP]

Help move this idea forward
  • Use the 👍 reaction to show support for this feature.
  • Avoid commenting unless you have relevant information to add; unnecessary comments create noise for subscribers.
  • Subscribe to receive notifications about status changes and new comments.

Is your feature request related to a problem? Please describe.

MOVE Operation of chunked upload copies file from staging area to destination instead of moving it.
This can lead to timeouts or delays the whole upload process.

Describe the solution you'd like

When the staging area and the destination are on the same partition, using move instead of copy could speed up the upload.

Additional context

Im not a php developer but tried to dig a little deeper.

In ChuningV2Plugin.php i can see how it distinguish between move and copy based on the fact if the file already exists. This does not cover my observation though. I uploaded a new file and it was copied in the end.
In fact tried to upload it first but it ran into a timeout. I increased the timeout and tried it again. Maybe the database entry was still there?

Also, what is the reason to copy to destination if the file already exists? Maybe to preserve the internal ID of the file in database?
Maybe anybody with more context can give insights here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/dav/lib/Upload/ChunkingV2Plugin.php around line 329, where the issue identifies the move-versus-copy decision. Trace how chunked uploads choose the operation for new and existing destination files, including the staging and destination locations. Done means safely using a move when the locations share a partition without breaking existing-file handling or database identity.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.