Server: Allow copying into same folder, append " (2)"

Created on 20 Jun 2018  Â·  9Comments  Â·  Source: nextcloud/server

I often need to make a backup before file sharing in modification mode. A possibility to copy or move files is implemented in Nextcloud, but it seems not possible to duplicate a file in the same folder because a renaming is not allowed. It would be nice to have such a mechanism allowing a duplication in one click.

enhancement files good first issue

Most helpful comment

@lightweight ok, "Copy of filename.txt" seems good too! :) What Gnome does:

  • filename (copy).txt
  • filename (another copy).txt
  • filename (3rd copy).txt
  • filename (4th copy).txt
  • etc

This is more obvious than just appending the number, which could also be a conflict or having uploaded the original file again.

All 9 comments

cc @nextcloud/designers Does this make sense from an UX point of view? I would just add it to the context menu where we already have the copy and move operations.

The problem here is that

it seems not possible to duplicate a file in the same folder

Because in the case of copying it in the same folder, you get this technical notification:

Could not copy "filename.txt", target exists

Instead, copying should simply work, and append a " (2)" to the filename. So from "filename.txt" to "filename (2).txt". (Or a " (3)" if a 2 already exists etc – just like we do for files drop.)

Or use what most filemanagers do: "copy of filename" as the default filename, and then it can be renamed... I agree that the current behaviour (not being able to copy a file into the same directory) is a significant problem for me (e.g. if I create a template/example file that I want to replicate as a specifically named file and alter the filename, I have to copy it first to another folder/directory first, and then back, which is ponderous and seemingly unnecessary given the fairly standard behaviour of other file managers).

@lightweight ok, "Copy of filename.txt" seems good too! :) What Gnome does:

  • filename (copy).txt
  • filename (another copy).txt
  • filename (3rd copy).txt
  • filename (4th copy).txt
  • etc

This is more obvious than just appending the number, which could also be a conflict or having uploaded the original file again.

I just encountered this issue when attempting to make a duplicate of a txt file in the Notes directory via the copy command. It is not currently possible, but I'd love to be able to duplicate the text file + re-name it to .md at the same time while using the copy menu. Something along the lines of:

"Markdown Examples.txt" already exists; Do you want to Duplicate or Rename the copy?

instead of current

Could not copy "Markdown Examples.txt"; target exists.

This remains an issue when copying a whole folder, the error target exists prevents duplicating a folder

@zeigerpuppy could you open a separate issue for that? :) It should indeed work the same as for files.

sure @jancborchardt, I have created issue #18846

Was this page helpful?
0 / 5 - 0 ratings