[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [16001]
From: |
nelson . guerra |
Subject: |
[Fmsystem-commits] [16001] |
Date: |
Wed, 16 Nov 2016 02:54:22 +0000 (UTC) |
Revision: 16001
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16001
Author: nelson224
Date: 2016-11-16 02:54:22 +0000 (Wed, 16 Nov 2016)
Log Message:
-----------
Modified Paths:
--------------
branches/dev-syncromind-2/property/inc/import/class.import_component_files.inc.php
Modified:
branches/dev-syncromind-2/property/inc/import/class.import_component_files.inc.php
===================================================================
---
branches/dev-syncromind-2/property/inc/import/class.import_component_files.inc.php
2016-11-15 14:40:54 UTC (rev 16000)
+++
branches/dev-syncromind-2/property/inc/import/class.import_component_files.inc.php
2016-11-16 02:54:22 UTC (rev 16001)
@@ -1,5 +1,5 @@
<?php
-
+
class import_component_files
{
private $receipt = array();
@@ -13,6 +13,7 @@
$this->path_upload_dir =
$GLOBALS['phpgw_info']['server']['files_dir'].$this->fakebase.'/';
$this->last_files_added = array();
+ $this->names = array();
}
public function get_path_upload_dir()
@@ -101,7 +102,7 @@
$message = array();
$uploaded_files = $this->_get_uploaded_files();
-
+
if ($this->receipt['error'])
{
return $this->receipt;
@@ -214,16 +215,28 @@
}
}
}
-
+
private function _un_zip($file, $dir)
{
+ header('Content-Type: text/plain; charset=utf-8');
+
@set_time_limit(5 * 60);
+ //$this->names = array();
+
+ mkdir($dir, 0777, true);
$zip = new ZipArchive;
if ($zip->open($file) === TRUE)
{
- $zip->extractTo($dir);
+ for($i = 0; $i < $zip->numFiles; $i++)
+ {
+ //$this->names[] = iconv("CP850",
"UTF-8", $zip->getNameIndex($i));
+ $filename = iconv("CP850", "UTF-8",
$zip->getNameIndex($i));
+ mkdir(dirname($dir.'/'.$filename),
0777, true);
+
copy("zip://".$file."#".$zip->getNameIndex($i), "{$dir}/{$filename}");
+ }
$zip->close();
+
return true;
} else {
$this->receipt['error'][] = array('msg' =>
lang('Failed opening file %1', $file));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [16001],
nelson . guerra <=