Code

Updated handling of uploaded files, thanks to bcooksley
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Nov 2010 09:15:08 +0000 (09:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Nov 2010 09:15:08 +0000 (09:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20241 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc

index 33685b9ececb43b71c5cc061408d14610a95f0a3..c986f7bcbae47c27e17d9aac8b99f9950ee7e3b3 100644 (file)
@@ -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:
 ?>