Skip to content

Listing of http server directory #283

Closed
@linev

Description

@linev

It is nice to be able list all files on http server and be able open them from JSROOT GUI.

Unfortunately, there is no standard way to list files on http server.
The only one can do - issue request to server directory and try to parse produced HTML file.

Feature is implemented as &dir=<url> parameter, but tested only with Apache http server.
It requires extra settings to work. One need to enable listing and enable CORS for returned HTML file.
Content of .htaccess file is:

# allow indexing of files
Options +Indexes
# Or, compress certain file types by extension:
AddEncoding gzip .gz
<FilesMatch "\.json.gz">
  ForceType application/json
</FilesMatch>
<FilesMatch "\.json">
  ForceType application/json
</FilesMatch>
<FilesMatch "\.xml">
  ForceType text/xml
</FilesMatch>
# Allow access from all domains for web fonts
<IfModule mod_headers.c>
    <FilesMatch "">
       Header set Access-Control-Allow-Origin "*"
       Header set Access-Control-Allow-Headers "range"
       Header set Access-Control-Expose-Headers "content-range,content-length,content-type,accept-ranges"
       Header set Access-Control-Allow-Methods "HEAD,GET"
    </FilesMatch>
</IfModule> 

In such configuration one can do listing like:

https://jsroot.gsi.de/dev/?dir=https://jsroot.gsi.de/files/

Feature will appear in version 7.6

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions