마이그레이션시 첨부파일을 localhost에서 copy하도록 수정

git-svn-id: http://xe-core.googlecode.com/svn/trunk@2066 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-07-28 11:43:50 +00:00
parent 29d8e91db0
commit 70713a033a

View file

@ -301,11 +301,18 @@
if(count($files)) {
foreach($files as $key => $val) {
$filename = $val->filename->body;
$url = $val->url->body;
$path = $val->path->body;
$download_count = (int)$val->download_count->body;
$tmp_filename = './files/cache/tmp_uploaded_file';
if(FileHandler::getRemoteFile($url, $tmp_filename)) {
if(preg_match('/[\xEA-\xED][\x80-\xFF]{2}/', $path)&&function_exists('iconv')) {
$tmp_path = iconv("UTF-8","EUC-KR",$path);
if(file_exists($tmp_path)) $path = $tmp_path;
}
if(file_exists($path)) {
@copy($path, $tmp_filename);
$file_info['tmp_name'] = $tmp_filename;
$file_info['name'] = $filename;
$this->oFileController->insertFile($file_info, $this->module_srl, $args->document_srl, $download_count, true);