fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [7156] property: more on fileuploader


From: Sigurd Nes
Subject: [Fmsystem-commits] [7156] property: more on fileuploader
Date: Fri, 01 Apr 2011 22:07:36 +0000

Revision: 7156
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7156
Author:   sigurdne
Date:     2011-04-01 22:07:35 +0000 (Fri, 01 Apr 2011)
Log Message:
-----------
property: more on fileuploader

Modified Paths:
--------------
    trunk/property/inc/class.botts.inc.php
    trunk/property/inc/class.fileuploader.inc.php
    trunk/property/inc/class.uientity.inc.php

Modified: trunk/property/inc/class.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2011-04-01 13:48:12 UTC (rev 
7155)
+++ trunk/property/inc/class.botts.inc.php      2011-04-01 22:07:35 UTC (rev 
7156)
@@ -1170,15 +1170,14 @@
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
 
-                       $bofiles        = CreateObject('property.bofiles');
                        
        //              if($check)
                        {
-       //                      $fileuploader->check($bofiles, 
"{$bofiles->fakebase}/fmticket/{$id}");
+       //                      $fileuploader->check($bofiles, 
"fmticket/{$id}");
                        }
        //              else
                        {
-                               $fileuploader->upload($bofiles, 
"{$bofiles->fakebase}/fmticket/{$id}");
+                               $fileuploader->upload("fmticket/{$id}");
                        }
                }
        }

Modified: trunk/property/inc/class.fileuploader.inc.php
===================================================================
--- trunk/property/inc/class.fileuploader.inc.php       2011-04-01 13:48:12 UTC 
(rev 7155)
+++ trunk/property/inc/class.fileuploader.inc.php       2011-04-01 22:07:35 UTC 
(rev 7156)
@@ -207,8 +207,9 @@
 
  */
 
-               function upload($bofiles, $save_path = '')
+               function upload($save_path = '')
                {
+                       $bofiles        = CreateObject('property.bofiles');
                        $use_vfs = true;
                        // Check post_max_size 
(http://us3.php.net/manual/en/features.file-upload.php#73762)
                        $POST_MAX_SIZE = ini_get('post_max_size');
@@ -294,7 +295,7 @@
                        }
 
 
-                       $to_file        = "{$save_path}/{$file_name}";
+                       $to_file        = 
"{$bofiles->fakebase}/{$save_path}/{$file_name}";
 
                        // Validate that we won't over-write an existing file
                        if ($bofiles->vfs->file_exists(array(
@@ -360,7 +361,7 @@
                        $bofiles->vfs->override_acl = 1;
                        if(!$bofiles->vfs->cp (array (
                                'from'  => $_FILES[$upload_name]["tmp_name"],
-                               'to'    => "{$save_path}/{$file_name}",
+                               'to'    => 
"{$bofiles->fakebase}/{$save_path}/{$file_name}",
                                'relatives'     => array 
(RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
                        {
                                $receipt['error'][]=array('msg'=>lang('Failed 
to upload file !'));
@@ -371,7 +372,7 @@
                        $bofiles->vfs->override_acl = 0;
 
 /*
-                       if (address@hidden($_FILES[$upload_name]["tmp_name"], 
"{$save_path}/{$file_name}"))
+                       if (address@hidden($_FILES[$upload_name]["tmp_name"], 
"{$bofiles->fakebase}/{$save_path}/{$file_name}"))
                        {
                                $this->HandleError("File could not be saved.");
                                exit(0);

Modified: trunk/property/inc/class.uientity.inc.php
===================================================================
--- trunk/property/inc/class.uientity.inc.php   2011-04-01 13:48:12 UTC (rev 
7155)
+++ trunk/property/inc/class.uientity.inc.php   2011-04-01 22:07:35 UTC (rev 
7156)
@@ -175,9 +175,13 @@
                        $test = false;//true;
                        if ($test)
                        {
-                               foreach ($_FILES as $fieldName => $file)
+                               if (!empty($_FILES))
                                {
-                                       move_uploaded_file($file['tmp_name'], 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/" . 
strip_tags(basename($file['name'])));
+                                       $tempFile = 
$_FILES['Filedata']['tmp_name'];
+                                       $targetPath = 
"{$GLOBALS['phpgw_info']['server']['temp_dir']}/";
+                                       $targetFile =  
str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
+                                       
move_uploaded_file($tempFile,$targetFile);
+                                       echo 
str_replace($GLOBALS['phpgw_info']['server']['temp_dir'],'',$targetFile);
                                }
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
@@ -190,9 +194,7 @@
                                $loc1 = 'dummy';
                        }
 
-                       $bofiles        = CreateObject('property.bofiles');
-
-                       $fileuploader->upload($bofiles, 
"{$bofiles->fakebase}/{$this->category_dir}/{$loc1}/{$id}");
+                       
$fileuploader->upload("{$this->category_dir}/{$loc1}/{$id}");
                }
 
                function get_files()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]