From: hickert Date: Wed, 17 Nov 2010 09:15:08 +0000 (+0000) Subject: Updated handling of uploaded files, thanks to bcooksley X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6005084da72c913318903f065127b3228dac1546;p=gosa.git Updated handling of uploaded files, thanks to bcooksley git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20241 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 33685b9ec..c986f7bcb 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -3873,5 +3873,29 @@ function gen_uuid() ); } +function gosa_file_name($filename) +{ + $tempfile = tempnam(sys_get_temp_dir(), 'GOsa'); + if(move_uploaded_file($filename, $tempfile)){ + return( $tempfile); + } +} + +function gosa_file($filename) +{ + $tempfile = tempnam(sys_get_temp_dir(), 'GOsa'); + if(move_uploaded_file($filename, $tempfile)){ + return file( $tempfile ); + } +} + +function gosa_fopen($filename, $mode) +{ + $tempfile = tempnam(sys_get_temp_dir(), 'GOsa'); + if(move_uploaded_file($filename, $tempfile)){ + return fopen( $tempfile, $mode ); + } +} + // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?>