my $zip = Archive::Zip->new(); # add all readable files and directories below . as xyz/* $zip->addTree( '/delme/wibble', 'customer_uploads' ); $zip->addFile( '/delme/wibble.tif', 'wibble.tif' ); $zip->addFile( '/delme/wibble.gif', 'wibble.gif' ); # and write them into a file $zip_return_code = $zip->writeToFileNamed('/delme/final_zipfile.zip'); if($zip_return_code != 0){ #an error occurred doing the zip $html_string = $html_string . "Error creating zip file . . . $zip_return_code $! "; }