diff --git a/inc/inc.ClassDownloadMgr.php b/inc/inc.ClassDownloadMgr.php index 8e30b9ed1..2c4ac4f52 100644 --- a/inc/inc.ClassDownloadMgr.php +++ b/inc/inc.ClassDownloadMgr.php @@ -174,13 +174,16 @@ class SeedDMS_Download_Mgr { return false; } - $file = tempnam("/tmp", "export-list-"); + $file = tempnam(sys_get_temp_dir(), "export-list-"); + if(!$file) + return false; $this->createToc($file); $zip = new ZipArchive(); $prefixdir = date('Y-m-d', time()); - if($zip->open($filename, ZipArchive::CREATE) !== TRUE) { + if(($errcode = $zip->open($filename, ZipArchive::OVERWRITE)) !== TRUE) { + echo $errcode; return false; } @@ -204,5 +207,6 @@ class SeedDMS_Download_Mgr { $zip->addFile($file, $prefixdir."/metadata.xls"); $zip->close(); unlink($file); + return true; } /* }}} */ }