gdcc / dataverse-previewers

A collection of Datafile Previewers that can be configured to work with Dataverse
MIT License
5 stars 15 forks source link

ZIP Previewer & File Downloader #7

Closed haarli closed 1 year ago

haarli commented 2 years ago

ZIP Previewer

This PR adds a previewer which allows to see the structure of a zip file in Dataverse. It also allows to download and extract single files from the ZIP without the need to download the whole ZIP. HTTP range requests are used for both functionalities, only the necessary byte ranges are downloaded. Downloading and extracting works fully client-side, so there might be limitations dependent on the browser.

The ZIP Previewer works with local file storage and S3 direct download (needs some CORS rules configured, see below). S3 with indirect download does not work well yet, as it seems to download the complete ZIP file to a temporary storage before doing the range request.

Requirements:

Acknowledgements

The ZIP previewer uses the zip.js library from Gildas Lormeau (https://github.com/gildas-lormeau/zip.js) and the fancytree library (https://github.com/mar10/fancytree) for rendering the treeview.

Screenshot:

grafik

haarli commented 2 years ago

Thanks for reviewing and testing.

Code was added to the previewers/betatest path and a new PR is created (https://github.com/gdcc/dataverse-previewers/pull/9).

We weren't aware of zip files not including separate entries for directories, do not have any in our repository. But of course, that's not the behaviour it should be. I'm afraid we cannot fix this for now, but hopefully at a later stage.

haarli commented 1 year ago

Replaced by https://github.com/gdcc/dataverse-previewers/pull/9