kater Posted September 7 Posted September 7 Hi, Failing to generate a zip from files array (rel. or abs., file-field from user template). No Errors. Generating from directory ($dir, inside assets) works just fine. Could it be a permission issue? https://processwire.com/api/ref/wire-file-tools/zip/ Thanks! // User files $invoices = []; $regUsers = $pages->find('template=user, check_access=0, include=hidden'); foreach ($regUsers as $regUser) { if ($regUser->user_invoices->last()) { $invoices[] = $regUser->user_invoices->last()->url; } } // ZIP Archiv $dir = wire('config')->paths->assets . "pdfs/"; //for testing $filename = "Invoices_" . date('d-m-y_H-m-s') . ".zip"; $zip = wire('config')->paths->assets . "pdfs-invoices/" . $filename; $result = wire('files')->zip( $zip, $invoices, array( 'overwrite' => 'true', 'allowHidden' => 'true' ) );
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now