Create a zip file from a list of selected files and make the zipped file downloadable I have a list of image files. I need to archive those files in zip format and make the archived file downloadable. I have seen ArchiverZip class defined in the system module of Drupal 7. But I couldn't be able to create a zip file. How can I do this in Drupal 7 ? Is there any hooks or custom modules for this ? Please help me out with this.

UPDATED
Following are the codes:

$zip = new ArchiverZip('archive.zip');
foreach($_POST['img'] as $fid):
    $query = db_select('file_managed', 'fn')
            -&gt;condition('fid', $fid)
            -&gt;fields('fn', array('filename'));
    $result = $query-&gt;execute();

    foreach($result as $row) {
        if(file_exists('sites/default/files/'.$row-&gt;filename)){
            var_dump($zip-&gt;add($base_path.'sites/default/files/'.$row-&gt;filename));
        }
    }
 endforeach;


And this reflects the following error


  Exception: Cannot open archive.zip in *ArchiverZip->__construct()* (line 91 of basepath\modules\system\system.archiver.inc).


Please help me with this . .
Make sure you include the class 

module_load_include('inc', 'zip_archive', 'zip_archive.class');


Also check permissions for archive.zip file. Create one if its not there.