evanmiller / mod_zip

Streaming ZIP archiver for nginx 📦
https://www.nginx.com/resources/wiki/modules/zip/
BSD 3-Clause "New" or "Revised" License
215 stars 64 forks source link

Manipulate directory paths in zipfile output #76

Closed mecampbellsoup closed 4 years ago

mecampbellsoup commented 4 years ago

Hi guys,

Just began using mod_zip recently - I have a setup working ATM whereby NGINX is serving zipfile requests; however, I want to know if it is possible to modify the directory paths in the unzipped contents.

The following screenshot should explain my question...

image

Instead of all the leading directory paths, I would prefer the output contents to omit those leading paths and simply unzip to the *.tif files contained at /mnt/data/userdata/{userhash}/outputs/cinema4d/23.008/{project-name}/{file-name}.

I imagine this should be possible using some NGINX rewrite or some other modification to my location, which looks like:

        # mod_zip location helper
        # Note: The leading ^~ is essential here, no more checks should be done after this match
        location ^~ /mnt/data/userdata/ {
            internal;
            root /;
        }

Thanks for your thoughts/help.

evanmiller commented 4 years ago

Hi, you can specify the output path in the manifest file.

mecampbellsoup commented 4 years ago

Ah, yea, thanks @evanmiller - the library I was using to generate the manifest for NGINX was doing something unexpected. All resolved, cheers.