From 6005084da72c913318903f065127b3228dac1546 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 17 Nov 2010 09:15:08 +0000 Subject: [PATCH] Updated handling of uploaded files, thanks to bcooksley git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20241 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) 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: ?> -- 2.30.2