Jump to content

Zip upload with saving folder structure


regesh
 Share

Recommended Posts

i wonder why there is still no answer... this is definitely possible.

i'm not a pro, but i would approach it like this:

use a file field to upload and store the zip-file.

create an autoload module with a hook into save or saveready (don't know what's better in this case) that unzips your file and saves the content where you define it

you could then delete the original zip-file.

problems i can think of that may happen (just guessing)

php zip support of your host

there could be problems with very large zip-files

https://www.google.at/search?q=site:processwire.com+unzip&gws_rd=cr&ei=ldrJVe-pOsj6abaUsLAF

https://processwire.com/talk/topic/5131-extracting-filenametargz-on-server/

you should take a look at somas grabpw script: https://raw.githubusercontent.com/somatonic/PWOnlineInstaller/master/grabpw.php

Link to comment
Share on other sites

It's certainly possible, but there's no fieldtype to support that. The standard file field might be sufficient to upload the zip file, but as soon as the zip is extracted with folder structure it won't display anything. If one doesn't need those files to be visible/manageable in the backend than all the tools php provides are available.

Link to comment
Share on other sites

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...