# Prevent Jabref from auto renaming and moving files

**URL:** <https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596>\
**Category:** Help\
**Created:** [March 9, 2021, 3:19am UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596 "2021-03-09T03:19:39Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![koppor](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/koppor/32/5_2.png) [@koppor](https://discourse.jabref.org/u/koppor)\
**Post date:** [February 28, 2024, 10:11pm UTC](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596/9 "2024-02-28T22:11:39Z")

</div>

Note that we had a preference for it: [Link file (without copying) doesn't work · Issue #5546 · JabRef/jabref · GitHub](https://github.com/JabRef/jabref/issues/5546)

A long discussion was made at [Dropping a PDF on an entry should be consistent · Issue #121 · JabRef/jabref · GitHub](https://github.com/JabRef/jabref/issues/121)

The dialog was as follows

 ![5d97be1a-130e-11e7-9ba5-fdd9037e3f3a](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/0/0175f07503214d715dd75777ca57aabf96d5b2b1.png)

* * *

We want to have “Remember decision”, thus we will re-add a preference.

Notes on the dialog:

- Outputting the file directory is nice, because it makes explicit, where the file will be placed
- “Copy to file directory” is a nice setting if one copies from a shared network folder. However, “move” should be default and “Copy” is only a secondary choice
- “Leave file in its current directory” is incomplete. It should be “Link the file”
- File renaming activation and showing the new file name is nice

### New Proposal

How would you like to treat the file ‘{file name}’ residing in {directory}?

- Link file
- Move file
- Copy file

(radio group)

* * *

Target directory is: {file directory}

- Rename file to {new file name}

(This part is only enabled if move or copy is selected)

* * *

#### Notes

- are the defaults to the radio group
- If file already resides inside a file directory, then “Link file” is the only enabled option AND “Rename file to” can be selected (because as user, I want to keep the file in the folder hierarchy of files). “a file directory” means that one JabRef’s file directories (global file directory, main file directory, user-specific file directory). – Let’s call this “Mode inside-bib-directory”
- org.jabref.model.database.BibDatabaseContext#getFirstExistingFileDir returns the target directory.
- org.jabref.model.entry.LinkedFile#findIn(java.util.List\<java.nio.file.Path\>) can be used to check if the file resides inside a directory (to switch the mode to “inside-bib-directory”)

---

_[View the full topic](https://discourse.jabref.org/t/prevent-jabref-from-auto-renaming-and-moving-files/2596)._
