# Is there any way to export the linked files as attachements?

**URL:** <https://discourse.jabref.org/t/is-there-any-way-to-export-the-linked-files-as-attachements/917>\
**Category:** Help\
**Created:** [November 26, 2017, 2:41am UTC](https://discourse.jabref.org/t/is-there-any-way-to-export-the-linked-files-as-attachements/917 "2017-11-26T02:41:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dellu](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/dellu/32/219_2.png) [@Dellu](https://discourse.jabref.org/u/Dellu)\
**Post date:** [November 26, 2017, 2:41am UTC](https://discourse.jabref.org/t/is-there-any-way-to-export-the-linked-files-as-attachements/917/1 "2017-11-26T02:41:10Z")

</div>

I was wondering if the linked files could be exported as attachments to other reference managers like Endnote and Bookends.

---

<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:** [November 27, 2017, 1:25pm UTC](https://discourse.jabref.org/t/is-there-any-way-to-export-the-linked-files-as-attachements/917/2 "2017-11-27T13:25:03Z")

</div>

Hi,

yes this is possible since a short time and is in the latest master [http://builds.jabref.org/master/](http://builds.jabref.org/master/)  
Either via File -\> Copy linked files to folder or via right click on the entries

---

<div class="post-metadata">

**Author:** ![Dellu](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/dellu/32/219_2.png) [@Dellu](https://discourse.jabref.org/u/Dellu)\
**Post date:** [November 27, 2017, 7:18pm UTC](https://discourse.jabref.org/t/is-there-any-way-to-export-the-linked-files-as-attachements/917/3 "2017-11-27T19:18:33Z")

</div>

hi @Siedlerchr  
Thank you for the reply.

The **copy files to Folder** seem to simply copy the files.  
I was rather thinking about exporting the references and the attachments together in endnote XML format (as in exporting from Mendeley to Endnote, for example) where the attachments will be recognized in Endnote.

But, I think I find the way to do it by editing the **custom export** filters described [here](https://help.jabref.org/en/CustomExports).

But, I still have a problem how the file names are written in the **file** field if you don’t mind me asking you another question.

Is it normal that the autolinking puts the file names twice in the **file** field?  
Here is an example reference:

```
    @Article{Bittner2003,
  author = {Maria Bittner},
  title = {Word order and incremental update},
  journal = {CLS},
  year = {2003},
  volume = {39},
  pages = {634–664},
  url = {http://cls.metapress.com/index/U74X466260054664.pdf},
  file = {Bittner2003 Word order and incremental update.pdf:Article/Bittner2003 - Word order and incremental update.pdf:PDF},
  groups = {LingBuzzBE},
}

```

Why do you think I have the file name listed twice?  
I was expecting only **Bittner2003 Word order and incremental update.pdf** part.

---

<div class="post-metadata">

**Author:** ![tobiasdiez](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/tobiasdiez/32/340_2.png) [@tobiasdiez](https://discourse.jabref.org/u/tobiasdiez)\
**Post date:** [November 27, 2017, 8:03pm UTC](https://discourse.jabref.org/t/is-there-any-way-to-export-the-linked-files-as-attachements/917/4 "2017-11-27T20:03:05Z")

</div>

The syntax for the file field is `description:path:type`. Previous versions (including 4.0 if I’m not mistaken) put the file name also as a description when you used the auto-link functionality. This should be fixed in the current development version.

If you can provide us with the syntax of how endnote expects attached files, we can improve the export code in this regard. Please open an issue on github with more details! Thanks.

---

<div class="post-metadata">

**Author:** ![Dellu](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/dellu/32/219_2.png) [@Dellu](https://discourse.jabref.org/u/Dellu)\
**Post date:** [November 27, 2017, 8:44pm UTC](https://discourse.jabref.org/t/is-there-any-way-to-export-the-linked-files-as-attachements/917/5 "2017-11-27T20:44:47Z")

</div>

hi @tobiasdiez  
As for the issues of multiple attachment, I have just reported in Github.

As for the syntax, here is one XLM syntax to export an article reference with its attachemnt.

```
<?xml version="1.0" encoding="UTF-8"?>
<xml>
	<records>
		<record>
			<ref-type name="Journal Article">0</ref-type>
			<contributors>
				<authors>
					<author>\author</author>
				</authors>
			</contributors>
			<titles>
				<title>\title</title>
			</titles>
                        <journal>\journal</journal>
			<pages>\pages</pages>
			<volume>\volume</volume>
			<issue>\issue</issue>
			<dates>
				<year>\year</year>
				<pub-dates>
					<date>\date</date>
				</pub-dates>
			</dates>
			<electronic-resource-num>\doi</electronic-resource-num>
                      <keywords>\keywords</keywords>
			<abstract>\abstract</abstract>
			<research-notes>\note</research-notes>
			<urls>
				<web-urls>
					<url>\url</url>
				</web-urls>
				<pdf-urls>
					<url>\file</url>
				</pdf-urls>
			</urls>
		</record>
	</records>
</xml>

```

This export filter, for example, is able to export an article reference with its attachment. With my samples containing simple file names, it has correctly exported to Zotero, Bookends and Endnote. I have already made [a complete](https://www.dropbox.com/s/21i215vy0q2svd5/BibtexPDF.zip?dl=0) template to export all the 7 types of references.

In this system, what the user needs to do is put the liked files in a directory and exported XML files in the same directory; and simply imported the xml to Endnote. The pdf attachments will be detected and imported along with each of the references. If the file field contains absolute paths, even the copying the linked files would be unnecessary. They can be simply detected from where they are.

But, the problem is if the file field contains duplicates, the pdf url misses it.
