From e0b2e0006fb526c118f3aa3d0f13da70957ad63c Mon Sep 17 00:00:00 2001 From: zero Date: Tue, 20 Mar 2007 06:48:19 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@566 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/file/file.model.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/modules/file/file.model.php b/modules/file/file.model.php index 978459765..12a0f8b5c 100644 --- a/modules/file/file.model.php +++ b/modules/file/file.model.php @@ -24,6 +24,13 @@ return (int)$output->data->count; } + /** + * @brief 다운로드 경로를 구함 + **/ + function getDownloadUrl($file_srl, $sid) { + return "./?module=file&act=procDownload&file_srl=".$file_srl."&sid=".$sid; + } + /** * @brief 파일 정보를 구함 **/ @@ -35,10 +42,7 @@ if(!$output->toBool()) return $output; $file = $output->data; - $direct_download = $file->direct_download; - - if($direct_download=='Y') $file->download_url = $uploaded_filename; - else $file->download_url = "./?module=file&act=procDownload&file_srl=".$file->file_srl."&sid=".$file->sid; + $file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid); return $file; } @@ -60,12 +64,7 @@ for($i=0;$idirect_download; - if($direct_download=='Y') { - $download_url = Context::getRequestUri().substr($file_list[$i]->uploaded_filename,2); - $file_list[$i]->download_url = $download_url; - } else { - $file_list[$i]->download_url = "./?module=file&act=procDownload&file_srl=".$file_list[$i]->file_srl."&sid=".$file_list[$i]->sid; - } + $file_list[$i]->download_url = $this->getDownloadUrl($file_list[$i]->file_srl, $file_list[$i]->sid); } return $file_list;