mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-18 10:49:54 +09:00
마이그레이션시 첨부파일을 localhost에서 copy하도록 수정
git-svn-id: http://xe-core.googlecode.com/svn/trunk@2066 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
29d8e91db0
commit
70713a033a
1 changed files with 9 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue