Archive Buttons Are Always disabled No Matter What

140 views Asked by At

I'm extending the java connector with some of the missing cmds. But I can't figure out why the archive buttons are always greyed out. I'm using 2.x nightly build.

I tried adding the following to the end of the server java connector's response the cmd=open

"options": {
    "copyOverwrite": 1,
    "path": "Desktop",
    "archivers": {
      "create": [
        "zip",
        "rar",
        "7z"
      ],
      "extract": [
        "zip",
        "rar",
        "7z"
      ]
    },
    "disabled": [],
    "separator": "/"
  }

This actually enabled the create (archive) button, but the extract is still disabled even when a zip archive for example is selected.

A little progress here

enter image description here

As can be seen here the extract is not working

enter image description here

I had a look through the php code, js and docs and haven't come across any likely suspescts

I also tried this.alwaysEnabled = true; in elFinder.prototype.command The JSDoc says: "If true, command can not be disabled by connector." So I have to assume it's not the connector.

Is there any other reason why extract would be disabled? Or js code section I can step through to get a feel for how it works

1

There are 1 answers

0
justify On BEST ANSWER

Using mime types in the JSON server response to open works

"archivers": {
    "create": [
        "application/x-tar", 
        "application/x-gzip", 
        "application/x-bzip2", 
        "application/x-xz", 
        "application/zip", 
        "application/x-7z-compressed"
    ], 
    "extract": [
        "application/x-tar", 
        "application/x-gzip", 
        "application/x-bzip2", 
        "application/x-xz", 
        "application/zip", 
        "application/x-7z-compressed"
    ]
}