Jump to content

unzip files and keep subfolders


rgaikema
 Share

Recommended Posts

Hi all,

Hopefully there's somebody who can help me with an issue while unzipping files.
My goal is to show banners in a portfolio.
In ProcessWire I have created a field, type 'Files', where I can upload the .zip files, one at a time.
I've selected the option Decompress ZIP files, but any subfolder in the .zip somehow disappears.
For example the 'assets' folder is gone after I uploaded the .zip file (see the attachment for the file structure).

I'm curious, is there a way to preserve the file structure inside a .zip file after unzipping it?

 

Kind regards,

Remco

Screen Shot 2018-10-02 at 13.47.58.png

Link to comment
Share on other sites

Thank you @kongondo!

My use case is to display a set of banners.
Since the banners themselves are in fact small pages (containing a.html & css file, some images, and a couple of JavaScript files and sometimes web fonts), my approach was to upload a .zip file containing all these files.
I made a template where I point to the uploaded folder to show the banner. I display it as an embedded iframe, for example "assets/843") and that works well, only if all the files are in the root folder of that .zip file.

But sometimes there are subfolders in the .zip file where extra images, or other assets are stored and needed for the banner.
You can imagine I don't want to manual adjust every banner by copying the files in the subfolder to the root and then adjust the .html and css file.
So it would save a lot of time to have the ability to upload .zip files with the file structure intact, including subfolders.

Any help is appreciated ?

 

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...