# Import adds PDF link \*and\* URL to file entry

**URL:** <https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484>\
**Category:** Help\
**Created:** [September 8, 2024, 7:10pm UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484 "2024-09-08T19:10:59Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![orionpilot](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@orionpilot](https://discourse.jabref.org/u/orionpilot)\
**Post date:** [September 8, 2024, 7:10pm UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/1 "2024-09-08T19:10:59Z")

</div>

I don’t know when it started, but at some point when importing a new entry (either with the arXiv downloader within JabRef or the browser extension), the `file` entry contains **both** the link to the PDF and the URL. On PC this does not matter, but when I try to open the PDF on my iPad using the .bib, the I app am using gets confused as it think its the whole `file` entry which is the link to the PDF. This is new behaviour. I just want the PDF link in the `file` entry. I can’t find anything in the settings which would allow be to turn off the URL in the `file` entry.

Example:

 ![example_PDF_and_link](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/8/846355751cde2583c5882c98ce6449674aa6da1f.png)

Removing everything after `PDF` fixes the issue.

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [September 8, 2024, 9:10pm UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/2 "2024-09-08T21:10:45Z")

</div>

Hi,

Indeed, this is fairly new and was requested and implemented by @ror3d and refs:

> <https://github.com/JabRef/jabref/issues/10848>
>
> \*\*Is your suggestion for improvement related to a problem? Please describe.\*\*
> A…t my work we share a bib file among 2-3 people that we keep updated to keep track of interesting papers, but due to policy, we can't share the actual PDFs.
> Trying to overcome this, we realized that if a file is downloaded, the original URL it was downloaded from is removed from the entry, so the file can't be easily redownloaded by other people using that link. Moreover, downloading it after the entry has been added seems to require manually downloading and adding it to the entry, which is not ideal.
> 
> \*\*Describe the solution you'd like\*\*
> Downloaded files should remember where they were downloaded from, and give a way to re-download them if they are missing from the directory.
> 
> \*\*Additional context\*\*
> I am working on a possible solution for this, I will PR when ready.

Maybe we can add a settings switch to toggle this behavior?

---

<div class="post-metadata">

**Author:** ![orionpilot](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@orionpilot](https://discourse.jabref.org/u/orionpilot)\
**Post date:** [September 9, 2024, 12:14am UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/3 "2024-09-09T00:14:34Z")

</div>

So that’s the use case for including the link in the file name. Thanks for sharing. This does seem like a good feature to have, I’m just in an edge case where it’s a hinderance.

I fully support adding a switch to toggle this behaviour. Hopefully it’s not too hard to implement.

---

<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:** [September 9, 2024, 9:05am UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/4 "2024-09-09T09:05:26Z")

</div>

@orionpilot Which iPad app do you use?

We have a discussion whether we should refactor the file field ([Refactor BibTeX file field · Issue #98 · JabRef/jabref · GitHub](https://github.com/JabRef/jabref/issues/98)). TL;DR: The pro side is, the file field could be more clean. The con side is that all aplications need to adapt…

In the concrete issue, JabRef’s behavior can be adapted to write a file field compatible with the iPad app.

---

<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:** [September 9, 2024, 9:05am UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/5 "2024-09-09T09:05:51Z")

</div>

Fix by @Siedlerchr: [Add pref switch to not store url by Siedlerchr · Pull Request #11735 · JabRef/jabref · GitHub](https://github.com/JabRef/jabref/pull/11735)

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [September 9, 2024, 11:51am UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/6 "2024-09-09T11:51:46Z")

</div>

@orionpilot You can now try the latest development version:

[https://builds.jabref.org/main/](https://builds.jabref.org/main/)

You can disable the feature in the preferences under Web Search “Keep downloaded url”

---

<div class="post-metadata">

**Author:** ![orionpilot](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@orionpilot](https://discourse.jabref.org/u/orionpilot)\
**Post date:** [September 9, 2024, 2:23pm UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/7 "2024-09-09T14:23:54Z")

</div>

I use [this app](https://apps.apple.com/us/app/references/id1481843213). Since JabRef is built on the bib file, I wanted something that also relies on the bib and this app fits that very well. I link the same folder (on the cloud) where my JabRef stores my PDFs and the app can find them. I will note that the app already works if there are more than 1 PDF linked in an entry.

The app does explicitly call out JabRef regarding using the `file` field to find the attachments.

---

<div class="post-metadata">

**Author:** ![orionpilot](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@orionpilot](https://discourse.jabref.org/u/orionpilot)\
**Post date:** [September 9, 2024, 2:37pm UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/8 "2024-09-09T14:37:16Z")

</div>

That was quick! And I’ve tested it and it works as expected!

While testing I’ve found that the app tries to find the PDF under its default name. However when I import the file, it gets auto-renamed to my preferred format. Without the auto-rename this may not have been noticed.

 ![References fail to find attachment](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/e/e4137247a354d61c41c3f4921b9f5403d550c8ed.jpeg)

In the example above, the PDF has the name between `Full Text PDF` and `.pdf:PDF`. But the app is trying to find the name between `articles/<name>.pdf`.

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [September 9, 2024, 3:55pm UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/9 "2024-09-09T15:55:40Z")

</div>

Okay, which app are you using? I don’t know how it works but jabref file format is pretty much  
`Description:path to full text.pdf:FileType`

---

<div class="post-metadata">

**Author:** ![orionpilot](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@orionpilot](https://discourse.jabref.org/u/orionpilot)\
**Post date:** [September 9, 2024, 5:49pm UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/10 "2024-09-09T17:49:52Z")

</div>

It’s called References. [More info in this reply](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/7).

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [September 10, 2024, 9:36pm UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/11 "2024-09-10T21:36:27Z")

</div>

I think you should submit feedback to the developer [References | Benjamin Burton](http://benburton.org/references/) (maybe even link to this thread)

Seems like they are not parsing the file field correctly:

This is JabRef’s implementation for writing the file field to bibtex: [jabref/src/main/java/org/jabref/logic/bibtex/FileFieldWriter.java at 14ba56d8ce19b80a53b1a22b10bb2d9da783f29a · JabRef/jabref · GitHub](https://github.com/JabRef/jabref/blob/14ba56d8ce19b80a53b1a22b10bb2d9da783f29a/src/main/java/org/jabref/logic/bibtex/FileFieldWriter.java#L16-L27)

(We also have corresponding tests)  
The counterpart would be the parser:

> <https://github.com/JabRef/jabref/blob/14ba56d8ce19b80a53b1a22b10bb2d9da783f29a/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java#L52>

---

<div class="post-metadata">

**Author:** ![orionpilot](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@orionpilot](https://discourse.jabref.org/u/orionpilot)\
**Post date:** [September 11, 2024, 3:30pm UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/12 "2024-09-11T15:30:53Z")

</div>

Understood, thanks for the info! I have submitted feedback to the developer and linked to this thread. I will update once I hear back.

---

<div class="post-metadata">

**Author:** ![orionpilot](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@orionpilot](https://discourse.jabref.org/u/orionpilot)\
**Post date:** [September 12, 2024, 12:17am UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/13 "2024-09-12T00:17:11Z")

</div>

The app developer has seen my email and will fix the parsing issue @Siedlerchr mentioned above in the next app update, expected to be released soon. I will update this thread once the update has been published and I have tested it.

---

<div class="post-metadata">

**Author:** ![orionpilot](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@orionpilot](https://discourse.jabref.org/u/orionpilot)\
**Post date:** [September 13, 2024, 8:55pm UTC](https://discourse.jabref.org/t/import-adds-pdf-link-and-url-to-file-entry/4484/14 "2024-09-13T20:55:34Z")

</div>

References v3.4 released 2024-09-13 fixes this issue. I have tested it and it works. The app can now find the PDF when the URL is included in the file entry. Even with this fix, I am happy that the next JabRef version will include a toggle for this behaviour.

Thank you all for the help and the quick turnaround!
