ui-monorepo icon indicating copy to clipboard operation
ui-monorepo copied to clipboard

Handle duplicate file uploads elegantly

Open FSM1 opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. Currently duplicate file uploads are not handled very well. The API will respond with a 409 error, and a notification will be displayed, but no further action will be presented to the user.

Describe the solution you'd like If a file with the same name already exists, a pop-up should be displayed to the user to allow them to either

  • Rename the newly uploaded file
  • Overwrite the existing file

image

FSM1 avatar May 11 '22 16:05 FSM1

Discuss the API changes with the team and continue scoping this out.

Preliminary idea is to make a request to the API with a full list of files to be uploaded, and the API to respond with any possible conflicting file names, as well as valid name that the file can be renamed to (if user wants to keep both files).

FSM1 avatar May 18 '22 15:05 FSM1

@dhyaniarun1993 API now returns a 409 in the event of a duplicate file upload anywhere in the request. Any files that are valid will be stored correctly in the filesystem. The API will respond with the file name that is a duplicate, as well as a suggestion of the name that the file can be renamed to -

i.e. if a path contains:

  • a.txt
  • a (1).txt

and the user attempts to upload a file called a.txt the API would respond with a valid name of a (2).txt

FSM1 avatar Jun 03 '22 15:06 FSM1