# Add archiv (tgz) file to a @Article entry

**URL:** https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526
**Category:** Help
**Created:** [March 20, 2017, 2:42pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526 "2017-03-20T14:42:20Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![buhtz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/buhtz/32/372_2.png) [@buhtz](https://discourse.jabref.org/u/buhtz)
#### Post date: [March 20, 2017, 2:42pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/1 "2017-03-20T14:42:20Z")

</div>

I tried to add an archiv (tgz, but could be anything else) file to an @Article.  
But the OK button in the file dialog is disabled because no “File Type” is selected automaticly. When I select one the button is enabled and I can save it.

But there is no “File Type” for any archiv or something like “Other”.

Is that part of the Biblatex standard or a “bug” of JabRef?

---

<div class="post-metadata">

### Author: ![matthiasgeiger](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/matthiasgeiger/32/7_2.png) [@matthiasgeiger](https://discourse.jabref.org/u/matthiasgeiger)
#### Post date: [March 20, 2017, 7:53pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/2 "2017-03-20T19:53:37Z")

</div>

You can manage the different file types using the “Options” -\> “Manage External File Types” dialog.  
Here you can add additional needed file types (e.g., tgz).

Regards,  
Matthias

---

<div class="post-metadata">

### Author: ![buhtz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/buhtz/32/372_2.png) [@buhtz](https://discourse.jabref.org/u/buhtz)
#### Post date: [March 21, 2017, 12:56pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/3 "2017-03-21T12:56:11Z")

</div>

This smells like a feature request and a bug report. But I need some more informations about it first. 😉

1. 

For myself I see no need to specifiy a type of the file in the "file = " line of the biblatex file. The filetype is most of the time specified by its extension. So in which usecases does a user need something like that?

1. 

It looks like that the possible (valid) values for the filetype in the "file = " line is restricted to the JabRef internal list of filetypes (Options -\> Manage External File Types). I tried to manualy edit the file type in the "file = " and set it to “Other”. In that case JabRef ignores it and doesn’t display that in the “File” field (there in the third column) of the “General” tab.  
I mean JabRef should display the filetype there no matter if it is in its interal list or not. I see no reason why JabRef shouldn’t do it. Do you?

1. 

In the “Manage External File Types” dialog is on “Application” specified for “PDF”. But when I click on the world-symbol of a library entry with a local linked pdf file it is opened without problems. How does open that PDF file without knowing a “Application”? Backwards question: Why is this “Application” in the file types dialog needed - or isn’t it?

---

<div class="post-metadata">

### Author: ![matthiasgeiger](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/matthiasgeiger/32/7_2.png) [@matthiasgeiger](https://discourse.jabref.org/u/matthiasgeiger)
#### Post date: [March 21, 2017, 6:36pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/4 "2017-03-21T18:36:36Z")

</div>

Buhtz,  
this is already working…

> [@buhtz](#):
>
> I tried to manualy edit the file type in the "file = " and set it to “Other”. In that case JabRef ignores it and doesn’t display that in the “File” field (there in the third column) of the “General” tab.

The file itself is shown in JabRef - however, as the type is unknown it is not shown (but is also not removed or overwritten upon saving).

If you want to have that file type recognized by JabRef (and potentially linked with an application) just add the type in the Manage File Types dialog.

> [@buhtz](#):
>
> In the “Manage External File Types” dialog is on “Application” specified for “PDF”. But when I click on the world-symbol of a library entry with a local linked pdf file it is opened without problems. How does open that PDF file without knowing a “Application”? Backwards question: Why is this “Application” in the file types dialog needed - or isn’t it?

Because for some filetype a default application is already defined by the operating system. I.e., the default Windows app for PDFs is automatically started. If you want to change the application - or in case no system default is present this can be changed/set in the file type dialog.

---

<div class="post-metadata">

### Author: ![buhtz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/buhtz/32/372_2.png) [@buhtz](https://discourse.jabref.org/u/buhtz)
#### Post date: [March 21, 2017, 7:05pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/5 "2017-03-21T19:05:37Z")

</div>

You missed 1. I still don’t understand in which usecases this filetype-field is needed. JabRef & Co could select the open-application depending on the filename-suffix.

> The file itself is shown in JabRef - however, as the type is unknown it is not shown (but is also not removed or overwritten upon saving).

This is what I tried to describe. And that behaviour makes no sense. 😉  
It looks like that there is code I JabRef that check if the FileType is known or not. If not it doesn’t show the filetype in the file-field in general-tab. There is no reason for that!  
JabRef should never ask that question at that point: “Do I know that FileType”? Just display it in the general-tab where it belongs. At that point it doesn’t matter if the type is “known” or not.  
I see no reason why the displayed filetypes should be restricted to the by-jabref-known-filetypes!?

---

<div class="post-metadata">

### Author: ![matthiasgeiger](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/matthiasgeiger/32/7_2.png) [@matthiasgeiger](https://discourse.jabref.org/u/matthiasgeiger)
#### Post date: [March 21, 2017, 7:48pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/6 "2017-03-21T19:48:26Z")

</div>

> [@buhtz](#):
>
> I still don’t understand in which usecases this filetype-field is needed.

In order to be able to define filetype specific application settings.

---

<div class="post-metadata">

### Author: ![buhtz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/buhtz/32/372_2.png) [@buhtz](https://discourse.jabref.org/u/buhtz)
#### Post date: [March 21, 2017, 8:59pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/7 "2017-03-21T20:59:23Z")

</div>

> In order to be able to define filetype specific application settings.

This is not what I meant. The question wasn’t about the in-jabref-filetypes.

Why is this filetype in the Biblatex-file?

And even jabref don’t need it. Use the file-extension. This would simplify the system/code.

---

<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: [March 21, 2017, 9:56pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/8 "2017-03-21T21:56:11Z")

</div>

The extension is taken into account, but sometimes Jabref isn’t able to infer the correct file type from it. In these cases the `file type` field can be used to help JabRef.  
To be exact, the following code shows how JabRef infers the correct file type:

```
    Optional<ExternalFileType> type = ExternalFileTypes.getInstance().getExternalFileTypeByName(entry.getFileType());

    if (deduceUnknownType && (type.get() instanceof UnknownExternalFileType)) {
        // No file type was recognized. Try to find a usable file type based
        // on mime type:
        type = ExternalFileTypes.getInstance().getExternalFileTypeByMimeType(entry.getFileType());
        if (!type.isPresent()) {
            // No type could be found from mime type on the extension:
            Optional<String> extension = FileUtil.getFileExtension(entry.getLink());
            if (extension.isPresent()) {
                Optional<ExternalFileType> typeGuess = ExternalFileTypes.getInstance()
                        .getExternalFileTypeByExt(extension.get());

                if (typeGuess.isPresent()) {
                    type = typeGuess;
                }
            }
        }
    }
```

---

<div class="post-metadata">

### Author: ![buhtz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/buhtz/32/372_2.png) [@buhtz](https://discourse.jabref.org/u/buhtz)
#### Post date: [March 22, 2017, 8:36am UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/9 "2017-03-22T08:36:21Z")

</div>

Ja und offensichtlich fehlt da etwas. 😃 Wenn dieser Code keinen FileType ermitteln kann, bleibt das Feld leer, obwohl im bib-File selbst ein FileType steht.

Konstruiertes Beispiel:  
`file = {:Files/ct.17.07.176-179.pdf:PDF;:Files/ct.17.07.176-179 - Die Beispielprogramme.tgz:Other},`

Warum kann er dann nicht einfach “Other” in das Type-Feld im General-Tab setzen?  
Also user denke ich beim leeren Feld: “Oh, da ist kein FileType. Muss ich noch ändern.” Dann guck ich in den bib-source und sehe, ach ist ja doch ein Type da.  
JabRef interpretiert hier nicht vollständig die Daten und bevormundet den User. Der String “Other” im bib-file ist ein Datum und wird von JabRef aber unterbunden/versteckt. Das ist einer freien Software nicht würdig.

Es geht hier nicht nur um praktische Aspekte, sondern auch ums Prinzip. 😉

btw: Muss mich mal wieder (nach 17 Jahren) mit Java beschäftigen. 😃

---

<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: [March 22, 2017, 9:00am UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/10 "2017-03-22T09:00:32Z")

</div>

Ich verstehe was du meinst:

Es sollte die Option geben den Filetype Other auszuwählen (wenn ich noch keinen eigenen definiert habe für z.B. tgz) beim hinzufügen einer neuen Datei und das dieser auch gespeichert wird.

Sollte eigentlich machbar sein, Muss man halt nur “Other” als Typ definieren, der nix macht.

---

<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: [March 22, 2017, 9:31am UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/11 "2017-03-22T09:31:16Z")

</div>

For reference: We discussed a redesign of the file field at [https://github.com/JabRef/jabref/issues/98](https://github.com/JabRef/jabref/issues/98), but we decided to keep is at is. However, I think, this discussion is unrelated to the discussion here, where it seems to offer a possibility to add support for `Other`.

---

<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: [March 22, 2017, 9:31am UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/12 "2017-03-22T09:31:43Z")

</div>

> [@buhtz](#):
>
> btw: Muss mich mal wieder (nach 17 Jahren) mit Java beschäftigen.

Sehr gerne! Wir hoffen, der Einstieg via [https://github.com/JabRef/jabref/blob/master/CONTRIBUTING.md](https://github.com/JabRef/jabref/blob/master/CONTRIBUTING.md) hilft.

---

<div class="post-metadata">

### Author: ![buhtz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/buhtz/32/372_2.png) [@buhtz](https://discourse.jabref.org/u/buhtz)
#### Post date: [March 22, 2017, 10:17am UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/13 "2017-03-22T10:17:23Z")

</div>

Diese Format von “file”: “link:description:type”…  
Ist das eine JabRef eigenen Konstruktion oder Bestandteil irgendeines applikationsunabhängigen Standards? In der Biblatex-Docu ist es nicht beschrieben.

---

<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: [March 22, 2017, 10:59am UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/14 "2017-03-22T10:59:13Z")

</div>

Das `file` Feld wird mMn nur von JabRef benutzt (ggf. noch bibdesk) und wurde danach in den “biblatex standard” aufgenommen.

---

<div class="post-metadata">

### Author: ![buhtz](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/buhtz/32/372_2.png) [@buhtz](https://discourse.jabref.org/u/buhtz)
#### Post date: [March 22, 2017, 2:47pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/15 "2017-03-22T14:47:19Z")

</div>

“file” wird im Standard erwähnt. Aber dessen Inhalt ist scheinbar nicht festgelegt.  
Woher komt also das Format “link:description:type”? Scheint also eine JabRef eigene Geschichte zu sein?

---

<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: [May 30, 2018, 12:04pm UTC](https://discourse.jabref.org/t/add-archiv-tgz-file-to-a-article-entry/526/16 "2018-05-30T12:04:27Z")

</div>

This was introduced by Morten Alver at the beginning of JabRef. For a long discussion see [https://github.com/JabRef/jabref/issues/98](https://github.com/JabRef/jabref/issues/98). Especially [https://github.com/JabRef/jabref/issues/98#issuecomment-134569224](https://github.com/JabRef/jabref/issues/98#issuecomment-134569224)

Feel free to join and motivate coders to implement

a) the new format  
b) migrations to the new format
