git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_SGD/trunk@23 eb19766c-00d9-a042-a3a0-45cb8ec72764
This commit is contained in:
parent
3f35584fda
commit
eeaa1d3e9e
@ -128,7 +128,9 @@ class KTPclZip {
|
|||||||
$excludePath = $this->getExcludePath($sFolder, DIRECTORY_SEPARATOR);
|
$excludePath = $this->getExcludePath($sFolder, DIRECTORY_SEPARATOR);
|
||||||
|
|
||||||
// Create the zip archive using the PclZip Wrapper
|
// Create the zip archive using the PclZip Wrapper
|
||||||
if ($this->_pclZip->create ( $sFolder , PCLZIP_OPT_REMOVE_PATH, $excludePath) == 0) {
|
if ($this->_pclZip->create ( $sFolder ,
|
||||||
|
PCLZIP_OPT_REMOVE_PATH, $excludePath,
|
||||||
|
PCLZIP_CB_PRE_ADD, 'convertFilenameEncoding_Add') == 0) {
|
||||||
//( File_Archive::read ( $this->sTmpPath . '/Root Folder' ), File_Archive::toArchive ( $this->sZipFileName . '.' . $this->extension, File_Archive::toFiles ( $this->sTmpPath ), $this->extension ) );
|
//( File_Archive::read ( $this->sTmpPath . '/Root Folder' ), File_Archive::toArchive ( $this->sZipFileName . '.' . $this->extension, File_Archive::toFiles ( $this->sTmpPath ), $this->extension ) );
|
||||||
return PEAR::raiseError ( _kt ( "Error compressing files" ) );
|
return PEAR::raiseError ( _kt ( "Error compressing files" ) );
|
||||||
}
|
}
|
||||||
@ -193,7 +195,8 @@ class KTPclZip {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($this->_pclZip->extract ( PCLZIP_OPT_PATH, $this->sTmpPath ) == 0) {
|
if ($this->_pclZip->extract ( PCLZIP_OPT_PATH, $this->sTmpPath,
|
||||||
|
PCLZIP_CB_PRE_EXTRACT, 'convertFilenameEncoding_Extract' ) == 0) {
|
||||||
return PEAR::raiseError ( _kt ( "<font color='red'>Error : Unable to unzip archive</font>" ) );
|
return PEAR::raiseError ( _kt ( "<font color='red'>Error : Unable to unzip archive</font>" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -515,7 +518,19 @@ class KTPclZip {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function convertFilenameEncoding_Extract($p_event, &$p_header)
|
||||||
|
{
|
||||||
|
$p_header['filename'] = iconv("CP437", "UTF-8", $p_header['filename']);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertFilenameEncoding_Add($p_event, &$p_header)
|
||||||
|
{
|
||||||
|
$p_header['stored_filename'] = iconv("UTF-8", "CP437", $p_header['stored_filename']);
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user