게시글 이동시 첨부파일쪽 문제 발생시 무시하고 실행되도록 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4057 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-03-31 02:09:28 +00:00
parent ce824ed878
commit 3ed13e73d5
2 changed files with 13 additions and 12 deletions

View file

@ -159,17 +159,18 @@
$file_info['tmp_name'] = $val->uploaded_filename;
$file_info['name'] = $val->source_filename;
$inserted_file = $oFileController->insertFile($file_info, $module_srl, $obj->document_srl, $val->download_count, true);
if($inserted_file && $inserted_file->toBool()) {
// 이미지/동영상등일 경우
if($val->direct_download == 'Y') {
$source_filename = substr($val->uploaded_filename,2);
$target_filename = substr($inserted_file->get('uploaded_filename'),2);
$obj->content = str_replace($source_filename, $target_filename, $obj->content);
// 이미지/동영상등일 경우
if($val->direct_download == 'Y') {
$source_filename = substr($val->uploaded_filename,2);
$target_filename = substr($inserted_file->get('uploaded_filename'),2);
$obj->content = str_replace($source_filename, $target_filename, $obj->content);
// binary 파일일 경우
} else {
$obj->content = str_replace('file_srl='.$val->file_srl, 'file_srl='.$inserted_file->get('file_srl'), $obj->content);
$obj->content = str_replace('sid='.$val->sid, 'sid='.$inserted_file->get('sid'), $obj->content);
// binary 파일일 경우
} else {
$obj->content = str_replace('file_srl='.$val->file_srl, 'file_srl='.$inserted_file->get('file_srl'), $obj->content);
$obj->content = str_replace('sid='.$val->sid, 'sid='.$inserted_file->get('sid'), $obj->content);
}
}
// 기존 파일 삭제

View file

@ -338,11 +338,11 @@
// 이미지인지 기타 파일인지 체크하여 upload path 지정
if(preg_match("/\.(jpg|jpeg|gif|png|wmv|wma|mpg|mpeg|avi|swf|flv|mp3|asaf|wav|asx|midi|asf)$/i", $file_info['name'])) {
$path = sprintf("./files/attach/images/%s/%s/", $module_srl,$upload_target_srl);
$path = sprintf("./files/attach/images/%s/%s", $module_srl,$upload_target_srl);
$filename = $path.$file_info['name'];
$direct_download = 'Y';
} else {
$path = sprintf("./files/attach/binaries/%s/%s/", $module_srl, $upload_target_srl);
$path = sprintf("./files/attach/binaries/%s/%s", $module_srl, $upload_target_srl);
$filename = $path.md5(crypt(rand(1000000,900000), rand(0,100)));
$direct_download = 'N';
}