From: hickert Date: Thu, 14 Oct 2010 07:48:47 +0000 (+0000) Subject: Updated handling for uploaded files. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=47941412120a23ffae891fd09310ea1bcfca3b82;p=gosa.git Updated handling for uploaded files. -Move them to a place where we can access uploaded files, even if save-mode is enabled. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20039 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index 254d4de49..7b17a5d3e 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -38,6 +38,7 @@ $domain = 'messages'; bindtextdomain($domain, LOCALE_DIR); textdomain($domain); + /* Remember everything we did after the last click */ session::start(); session::set('errorsAlreadyPosted',array()); @@ -53,6 +54,17 @@ $clicks ++ ; session::set('clicks', $clicks); +/* On some systems we can not operate on uploaded tmp files. We need to + * explicitely copy them first + */ +foreach($_FILES as $postName => $entry){ + $tempfile = tempnam(sys_get_temp_dir(), 'GOsa'); + if(move_uploaded_file($_FILES[$postName]['tmp_name'], $tempfile)){ + $_FILES[$postName]['tmp_name'] = $tempfile; + } +} + + pathNavigator::clear(); if ($_SERVER["REQUEST_METHOD"] == "POST"){