From: skodak Date: Sat, 2 Aug 2008 18:42:38 +0000 (+0000) Subject: MDL-15919 unzipping support X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7c53e3e5de399d9de5458e00751c441a3ed44802;p=moodle.git MDL-15919 unzipping support --- diff --git a/lib/file/file_packer.php b/lib/file/file_packer.php index 3263763ec0..a3b90c8f05 100644 --- a/lib/file/file_packer.php +++ b/lib/file/file_packer.php @@ -209,7 +209,7 @@ class file_packer { } else { // large file, would not fit into memory :-( - $tmpfile = tempnam($CFG->dataroot.'/temp/unzip'); + $tmpfile = tempnam($CFG->dataroot.'/temp/unzip', 'largefile'); if (!$fp = fopen($tmpfile, 'wb')) { $processed[$name] = 'Can not write temp file'; // TODO: localise continue; @@ -224,7 +224,7 @@ class file_packer { } fclose($fz); fclose($fp); - if (strlen($tmpfile) !== $size) { + if (filesize($tmpfile) !== $size) { $processed[$name] = 'Unknown error during zip extraction'; // TODO: localise // something went wrong :-( @unlink($tmpfile);