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;