Endpoint to offer non-conflicting file name
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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