nextcloud / nextcloud/server

Endpoint to offer non-conflicting file name

Open
#34,385 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Currently each client when uploading a file checks if the file already exists via a head operation.
If this file exists, it adds (2) to it, retries and might continue with (3), (4), etc.

Idea is now to have a new endpoint, which returns smallest available number:
client -> server: path: "/Talk/image.png"
client <- server: path: "Talk/image (51).png"

New workflow would then be when trying to upload a file

  • client tries first head operation (as >90% of filenames are unique)
  • if file does not exist: upload
  • if file exists: ask new endpoint
  • upload with new file name

@PVince81

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 by locating the server-side upload and HEAD request handling, then trace how existing file names are checked and altered. Define where the proposed endpoint fits and verify its response for a path such as "/Talk/image.png". Done means clients can request the smallest available number after a conflict and upload using the returned path.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.