CodeIgniter Forums
Zip class question - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Zip class question (/thread-25557.html)

Zip class question - El Forum - 12-16-2009

I'm using the zip class to make a backup of one directly and save the resulting zip file to another. It works great, but maintains the parent directory structure when I just want the files. To illustrate:
The data to save:

Where to save it:

Downloading and extracting '' shows the datastore/xml directories and I just want the XML files. Here's the code I've used:

$filename = 'xml-'.date('Y.m.d-H.i.s').'.zip';


Do I need to not use read_dir and instead parse the directory and add each XML file individually?