mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
좀 더 정확하게 파일 경로 지정
This commit is contained in:
parent
7125cf0e12
commit
dc79c3ea9d
2 changed files with 27 additions and 3 deletions
|
|
@ -47,8 +47,14 @@ class fileModel extends file
|
|||
$obj->source_filename = $file_info->source_filename;
|
||||
$obj->file_size = $file_info->file_size;
|
||||
$obj->disp_file_size = FileHandler::filesize($file_info->file_size);
|
||||
if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
|
||||
else $obj->download_url = $file_info->uploaded_filename;
|
||||
if($file_info->direct_download == 'N')
|
||||
{
|
||||
$obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl);
|
||||
}
|
||||
else
|
||||
{
|
||||
$obj->download_url = $this->getDirectFileUrl($file_info->uploaded_filename);
|
||||
}
|
||||
$obj->direct_download = $file_info->direct_download;
|
||||
$obj->cover_image = ($file_info->cover_image === 'Y') ? true : false;
|
||||
$files[] = $obj;
|
||||
|
|
@ -109,7 +115,23 @@ class fileModel extends file
|
|||
{
|
||||
return sprintf('?module=%s&act=%s&file_srl=%s&sid=%s&module_srl=%s', 'file', 'procFileDownload', $file_srl, $sid, $module_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return direct download file url
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
*/
|
||||
function getDirectFileUrl($path)
|
||||
{
|
||||
if(dirname($_SERVER['SCRIPT_NAME']) == '/' || dirname($_SERVER['SCRIPT_NAME']) == '\\')
|
||||
{
|
||||
return '/' . substr($path, 2);
|
||||
}
|
||||
|
||||
return dirname($_SERVER['SCRIPT_NAME']) . '/' . substr($path, 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get file configurations
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue